- Notifications
You must be signed in to change notification settings - Fork1.7k
JS: Diff-informed queries: phase 3 (non-trivial locations)#20078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR enables diff-informed mode on JavaScript queries that select locations other than dataflow sources or sinks by implementing non-trivial location overrides. The changes add the necessary predicates to support diff-informed incremental analysis while ensuring proper location reporting for query results.
Key changes:
- Adds
observeDiffInformedIncrementalMode()
predicates to enable/disable diff-informed mode on specific queries - Implements
getASelectedSinkLocation()
methods to override location selection for queries with custom highlighting logic - Refactors location selection logic to handle cases where custom sink highlighting is available
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
decodeJwtWithoutVerification.ql | Disables diff-informed mode due to secondary config usage |
EnvValueAndKeyInjection.ql | Disables diff-informed mode due to complex location override requirements |
ShellCommandInjectionFromEnvironmentQuery.qll | Enables diff-informed mode and refactors location selection logic |
IndirectCommandInjectionQuery.qll | Enables diff-informed mode and refactors location selection logic |
This PR enables diff-informed mode on queries that select a location other than dataflow source or sink. This entails adding a non-trivial location override that returns the locations that are actually selected.
Prior work includes PRs like#19663,#19759, and#19817. This PR uses the same patch script as those PRs to find candidate queries to convert to diff-enabled. This is the final step in mass-enabling diff-informed queries on all the languages.
Commit-by-commit reviewing is recommended.