JS: Fix bug causing re-evaluation of cached barriers#17643
Merged
asgerf merged 3 commits intogithub:js/shared-dataflow-branchfrom Oct 3, 2024
Merged
JS: Fix bug causing re-evaluation of cached barriers#17643asgerf merged 3 commits intogithub:js/shared-dataflow-branchfrom
asgerf merged 3 commits intogithub:js/shared-dataflow-branchfrom
Conversation
Previously only reflected XSS used shared barrier guards.
9ac1019 to
5d2ce17
Compare
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 a bug that caused cached barriers nodes to be re-evaluated. Specifically, this predicate in
TaintTrackingPrivatewas re-evaluated due to the cachedAdditionalSanitizerGuardNodeinheriting from the query-specificSanitizerGuard:The
AdditionalSanitizerGuardNodeclass no longer inherits fromSanitizerGuardNodewhich means itssanitizes/blockspredicates have their own rootdef now.Update to XSS queries
This revealed a bug in the some of the ported XSS queries in that they didn't explicitly include the shared XSS barrier guards. In many (but not all) cases those barrier guards worked anyway because they shared their
thisvalue with anAdditionalBarrierGuardwhich meant their overrides were in effect (for suchthisvalues), even if not explicitly opted into.This is similar to the old problem with
isBarrierGuardNode()not being able to accurately choose a class to include, but only a set of values, and then we get interference from unrelated classes containing that value. Note that this can't happen anymore as queries now have their ownBarrierGuardNoderoot class, butAdditionalSanitizerGuardNodehadn't yet been refactored this way until now.Evaluation
Evaluation shows a 2% performance improvement, as a result of fixing the cache re-evaluation bug.
The performance impact is more significant for the use-use flow branch, as it needs to do more work with barriers, and this PR is needed to unblock the use-use flow branch.