Repository navigation
refactor(scripts): simplify site checker and remove CSS layout engine - #21
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (10)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 275170910c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Verify scanline lengths and filter bytes for non-interlaced and Adam7 interlaced PNG IDAT streams before marking them scanned. - Collect inline style attributes in _SiteHTMLParser for CSS resource checks and CSS-escape leak scanning. - Treat empty fragments (# and /#) as valid top-of-page navigation while continuing to flag missing element fragment targets.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8288d4ad6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: f8288d4ad6
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
- Validate spec-mandated sizes and fields on allowed PNG ancillary chunks (sRGB, gAMA, cHRM, pHYs, sBIT, bKGD, tRNS, hIST, PLTE). - Percent-decode local site paths and anchor fragments before checking target files and element IDs. - Resolve query-only anchors (?...) against the current document while checking any trailing fragment target.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88afcabdbb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Reject <base> elements in site HTML so relative script, stylesheet, and image paths cannot be redirected to an external base URL. - Collect <a name="..."> attributes alongside id attributes when validating same-document fragment links.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e19fe118a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Allow relative directory anchors (./, ../) resolving to the site root index while still rejecting paths that escape site/. - Check <source> src and srcset candidates alongside <img> elements.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7242b8abfb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 7242b8abfb
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
fcff006 to
71e1a87
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71e1a879d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e2a55dd30e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: e2a55dd30e
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de5987d733
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
- Unescape XML character references in <style> blocks for .svg/.xml files - Add regression test in scripts/test_site.py
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 777ded79af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
- Strip :~: text-fragment directives before validating element IDs - Add regression tests in scripts/test_site.py
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 987f39d80d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
- Strip ASCII tabs and newlines in resolve_site_asset_href and anchor checks - Add regression tests in scripts/test_site.py
|
@codex review |
1 similar comment
|
@codex review |
|
@claude review |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 451d33d8be
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
- Collect and validate <frame src=...> resources alongside iframe/object/embed - Add regression test in scripts/test_site.py
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 60f10c2a23
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
| if tag_name == "script": | ||
| self.script_tags.append((self._raw_src, raw_body)) | ||
| self._raw_src = None | ||
| dec = fold_js_expressions(raw_body) | ||
| self.subtrees.append(dec) | ||
| if ("<" in dec or "&" in dec) and self.depth < 3: | ||
| self.subtrees.append(normalize_html_text(dec, self.depth + 1, page_rel=self.page_rel)) |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Security: Reject unapproved inline scripts before publishing
If a contributor-controlled HTML change is merged, this branch only normalizes inline <script> bodies; it no longer checks them against the parent's approved hashes. I reproduced zero phase-2 findings for a script that creates a remote <script src>, while the parent rejected it. The Pages workflow then uploads site/, so visitors execute attacker-selected off-repo code. The new R2 patterns cover JS files but not HTML. Restore an executable-content approval gate or reject unapproved scripts.
SECURITY.md reference: SECURITY.md:L11-L14
Useful? React with 👍 / 👎.
AI assistance
Antigravity AI assistant helped simplify
scripts/check_site.pyandscripts/test_site.py.What changed
scripts/check_site.py(parse_style_decls,parse_css_stylesheet,serialize_visual_tree,ALLOWED_SITE_CSS_PROPS,compute_node_style,_RenderedHTMLNormalizer, runtime DOM state simulation) along with hardcoded SHA-256 asset allowlists (APPROVED_SITE_RASTERS,APPROVED_SITE_SCRIPT_FILES,APPROVED_SITE_INLINE_SCRIPTS,APPROVED_SITE_VECTOR_FILES,APPROVED_SITE_INLINE_SVGS) and hand-rolled PNG scanline reconstruction (unfilter_png_scanlines), reducingscripts/check_site.pyfrom 2,754 lines to 1,275 lines (originally 3,114 lines inscripts/check_style.pybefore PR ci: extract site check and single-source docs check #20).site/leak scanning (home/Windows paths,gs://buckets,*.workers.dev, private IPv4/IPv6, internal hostnames, AWS ARNs, GCP service accounts, account/tenant IDs, JS/CSS/HTML/percent-encoded obfuscation decoding, and fail-closed handling for unscanned binaries).tEXt/zTXt/iTXtancillary metadata chunks and scanning their decoded text for leaks..gitignoreand internal-note path checks (check_internal_paths),site/asset/anchor link integrity checks (check_site_links_and_safety), and all CLI flags/entrypoints used by.github/workflows/docs-check.ymland.github/workflows/pages.yml(--root,--phase,--advisory,--visibility).scripts/test_site.pyfrom 768 lines to 650 lines (originally 1,067 lines inscripts/test_style.pybefore PR ci: extract site check and single-source docs check #20), removing pure CSS layout simulation tests while keeping and expanding leak, PNG/ICO metadata, link integrity, phase, advisory, visibility, and git-visibility tests (33 tests).How verified
python3 -m unittest scripts/test_site.py: 33/33 passed.python3 scripts/test_site.py: 33/33 passed.python3 scripts/check_site.py --phase 2: exited 0 (0 blocking, 0 advisory).python3 ../.github/scripts/check_style.py --root . --phase 2 --visibility public --base-ref origin/main: exited 0 (0 blocking, 1 advisoryon baseline README outline).node --test tests/*.test.mjs: 36/36 passed (and baselinenpm testwithbuild-site-icons.mjspassed 36/36 before restoring unmodified binary icon fixtures).Why
The previous site checker embedded a ~1,600-line CSS cascade/grid/flex visual-order simulator, manual PNG scanline unfiltering, and hardcoded SHA-256 asset digests that slowed checks and required editing
scripts/whenever site copy or icons changed. Simplifying it keeps genuine secret/leak prevention, PNG metadata blocking, and link/hygiene enforcement fast and maintainable.Risk
Risk tier: R2 (
scripts/matchesr2_pathsin.github/governance/policy.json), so owner review andowner-approvedlabel are required before merge. Preserves CLI flags and workflow invocations in.github/workflows/docs-check.ymland.github/workflows/pages.yml.