JS: add additional array-specific taint steps#192
Merged
Conversation
asger-semmle
suggested changes
Sep 13, 2018
| name = "shift" or | ||
| name = "slice" or | ||
| name = "splice" | | ||
| pred.(DataFlow::SourceNode).getAMethodCall(name) = call and |
Contributor
There was a problem hiding this comment.
We don't normally backtrack the predecessor to its local source; only the successor needs to follow backward data flow in case of object mutation. Ordinary data flow will carry the taint from the source to the predecessor node anyway.
It might interfere with how flow through refinement nodes and guard sanitizers work (as it might bypass them), and create slight inconsistencies in path explanations. I'd prefer that we just do
pred = call.(DataFlow::MethodCall).getReceiver().
Author
There was a problem hiding this comment.
Good catch, amended as call.(DataFlow::MethodCallNode).calls(pred, name)
Contributor
|
Otherwise LGTM |
aibaars
added a commit
that referenced
this pull request
Oct 14, 2021
Build workflow: create release
smowton
pushed a commit
to smowton/codeql
that referenced
this pull request
Jan 17, 2022
Test case for generic inner type instantiation
MathiasVP
pushed a commit
to MathiasVP/ql
that referenced
this pull request
Aug 10, 2025
Sync Main: More Misc Bugs (token related bugs)
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 adds the array methods:
.unshift,.pop,.shift,.slice,.splice,Array.fromas taint steps. I also did a minor refactoring inTaintTracking.qll.This change seems to have a minor overhead, wihin the margin of error. Evalution.