Add CodeQL query for reflected XSS in Vercel serverless functions#1147
Draft
murderteeth wants to merge 1 commit intomainfrom
Draft
Add CodeQL query for reflected XSS in Vercel serverless functions#1147murderteeth wants to merge 1 commit intomainfrom
murderteeth wants to merge 1 commit intomainfrom
Conversation
CodeQL has no built-in framework model for @vercel/node, so the standard js/reflected-xss query cannot detect XSS in api/ handlers. This adds a custom query with inline Vercel framework models that detects reflected XSS specifically. Other vulnerability types (SSRF, SQLi, etc.) in Vercel handlers are NOT covered by this change — that requires either duplicating the model into additional query files or contributing the model upstream to github/codeql. Also upgrades the CI workflow: actions to v4, enables security-extended query suite, and runs the custom query pack alongside standard queries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Dependency ReviewThe following issues were found:
Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. License Issues.github/workflows/codeql.yml
OpenSSF Scorecard
Scanned Files
|
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.
Summary
@vercel/node, so the standardjs/reflected-xssquery misses vulnerabilities inapi/serverless handlers. This adds a custom CodeQL query with inline Vercel framework models that detects reflected XSS specifically.actions/checkoutandcodeql-actionto v4, enablessecurity-extendedquery suite, and runs the custom query pack alongside standard queries.What the custom model teaches CodeQL
VercelRequest-typed first parameterreq.query,req.body,req.headers,req.cookiesres.send(),res.status().send()res.setHeader()(used to determine content-type for XSS relevance)Test plan
api/vault/meta.tssecurity-extendedsuite runs without regressions🤖 Generated with Claude Code