JS: Use TaintedUrlSuffix flow label to avoid FPs from $(location.hash)#6433
Merged
codeql-ci merged 6 commits intogithub:mainfrom Aug 12, 2021
Merged
JS: Use TaintedUrlSuffix flow label to avoid FPs from $(location.hash)#6433codeql-ci merged 6 commits intogithub:mainfrom
codeql-ci merged 6 commits intogithub:mainfrom
Conversation
erik-krogh
reviewed
Aug 9, 2021
Comment on lines
+70
to
+72
| // Substring that is not a prefix | ||
| name = ["substring", "substr", "slice"] and | ||
| not call.getArgument(0).getIntValue() = 0 | ||
| or |
Contributor
There was a problem hiding this comment.
Right now we have about 4-5 locations in our code where we handle substring/substr/slice.
I think we could use a common class in StringOps.
Otherwise 👍
But you need to run the autoformatter.
erik-krogh
previously approved these changes
Aug 9, 2021
fdbc917 to
d83f5a9
Compare
Contributor
Author
|
@erik-krogh can you take a quick look at the last commit? (the only one that changed after rebasing) |
erik-krogh
approved these changes
Aug 11, 2021
Contributor
erik-krogh
left a comment
There was a problem hiding this comment.
@erik-krogh can you take a quick look at the last commit? (the only one that changed after rebasing)
👍
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.
Fixes some FPs where
location.hashflows to$()in a non-trivial way that preserves the#prefix.This introduces the
TaintedUrlSuffixflow label as a reusable flow label, although at the moment we only use it for detecting$()injection. The flow label includes most ordinary taint steps in its step relation -- a pattern which originally caused performance issues (materializing a separate copy of the taint step relation). This no longer seems to cause problems, which is possibly due to #5396 having been merged in the meantime, though I haven't verified the exact reason.Evaluation was uneventful.