JS: Add URL constructor taint tracking for request forgery#19634
Merged
Napalys merged 4 commits intogithub:mainfrom Jun 2, 2025
Merged
JS: Add URL constructor taint tracking for request forgery#19634Napalys merged 4 commits intogithub:mainfrom
Napalys merged 4 commits intogithub:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances SSRF detection by tracking taint flow through the URL constructor in both tests and analysis logic.
- Added new test cases in
serverSide.jsto cover taint propagation vianew URL(...) - Updated expected results in
RequestForgery.expectedfor the new flows - Extended the taint analysis in
RequestForgeryCustomizations.qllto recognize theURLconstructor - Documented the change in
change-notes
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| javascript/ql/test/query-tests/Security/CWE-918/serverSide.js | Added a new server using new URL(input) and HTTP calls for SSRF |
| javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected | Updated expected taint flow edges for URL constructor cases |
| javascript/ql/lib/semmle/javascript/security/dataflow/RequestForgeryCustomizations.qll | Introduced an exists clause for taint flow through URL |
| javascript/ql/lib/change-notes/2025-05-30-url-package-taint-step.md | Added a note about the minor analysis update |
Comments suppressed due to low confidence (1)
javascript/ql/lib/semmle/javascript/security/dataflow/RequestForgeryCustomizations.qll:87
- There is an extra '|' before the
succclause in theexistsexpression. QL expects a single '|' followed by combined predicates; replace the second '|' with 'and' or separate conditions with commas.
|
asgerf
previously approved these changes
Jun 2, 2025
…ep.md Co-authored-by: Asger F <asgerf@github.com>
asgerf
approved these changes
Jun 2, 2025
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.
This PR enhances the request forgery (SSRF) detection by adding support for tracking taint flow through the
URLconstructor.