Validate vulnerability id before use in the DOM (DOCS-106) - #3740
Merged
Conversation
Guard the id returned by getVulnID() with a strict allowlist
(^[A-Za-z0-9._-]{1,64}$), returning "" for anything else. getVulnID is
the single source for the id that flows into every DOM sink on the page
(canonical link href, innerHTML, meta content), so validating once
neutralizes the CodeQL client-side URL redirect finding (chainguard-dev#97) and the
related DOM-XSS in the neighboring innerHTML sink.
Legitimate identifiers (CVE-..., GHSA-...) pass unchanged. Also drop a
dead `let id = ""` initializer that both branches immediately reassign.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ Deploy Preview for ornate-narwhal-088216 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
s-stumbo
approved these changes
Aug 7, 2026
SharpRake
approved these changes
Aug 7, 2026
matthewhelmke
deleted the
matthewhelmke/docs-106-fix-codeql-client-side-url-redirect-dom-xss-in-rumble
branch
August 7, 2026 18:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Validate the vulnerability
idat its source before it reaches the DOM, resolving the open CodeQL alert #97 (js/client-side-unvalidated-url-redirection, CWE-601 / CWE-79 / CWE-116) inassets/js/rumble/vulnerability.js.getVulnID()is the single choke point: theidit returns (from the?id=query param on preview/localhost, or the URL path segment in prod) flows into every DOM sink on the page —link.href(the flagged line), plusinnerHTMLand metacontent. Guarding it once neutralizes all of them:Legitimate identifiers (
CVE-2024-1234,GHSA-xxxx-xxxx-xxxx) pass unchanged; anything containing HTML/URL metacharacters is rejected. Also dropped a deadlet id = ""initializer (both branches reassign it) that eslint'sno-useless-assignmentflagged.Why validate at the source
The flagged sink (
link.href += idon the canonical<link>) is low real-world risk on its own, but the same untrustedidis written unescaped toinnerHTMLa few lines up — a genuine DOM-XSS vector. Validating the shared source is cleaner and more robust than escaping each sink individually, and matches CodeQL's own "validate against an allowlist" recommendation.Testing
""—<img src=x onerror=…>,"><script>,//evil.com,https://evil.com,javascript:…,../../etc/passwd, query-string injection, an over-length string, andnull/empty.npm run buildsucceeds (JS bundles via Hugo/esbuild).Linear: DOCS-106
Created in collaboration with Claude Code running Opus 4.8 on 2026-08-07.