-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Python: Diff-informed queries: phase 3 (non-trivial locations) #20079
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 our terms of service and privacy 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?
Conversation
…urce (TODO: add source with true positive)
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.
- Thank you for fixing the select statements in the queries. They looked wrong before as
.getResultType()
is a string and not something that has a meaningful location. - The DCA run doesn't run the changed queries (
nightly.qls
doesn't contain the experimental queries). Consider runningsecurity-experimental
instead. This suite containspy/possible-timing-attack-against-hash
but it doesn't containpy/timing-attack-against-hash
(as this query doesn't have theexperimental
tag - which looks like a mistake though). - IMO your don't need to add a new test case for the query as these are purely experimental queries and since the query in question (
py/timing-attack-against-hash
) is not even in the experimental suite. If you are interested in playing around with making a proper test, then as you write in the description, one way of emulatingremote
user input could be by using MaD. I am not familiar with MaD for Python, but maybe inspiration can be drawn from here (where kind needs to beremote
instead) - making anext.yml
file next to the test can make someremote
sources that only has the test as scope.
Started a |
Might not be a mistake actually, as the produced alerts are a subset of the alerts produced by |
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.
LGTM!
Can be merged unless DCA indicates otherwise.
10s slowdown on py/possible-timing-attack-against-hash on cpython, but given that we don't see a similar slowdown on other dbs or on py/timing-attack-against-hash (same kind of change), it could be a fluke. |
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.
Potentially tricky cases: