-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Python: Fix iterable-unpacking taint CP #3132
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
Python: Fix iterable-unpacking taint CP #3132
Conversation
When running ql/python/ql/src/Security/CWE-079/ReflectedXss.ql against the database for flask. Iitially there were 10 million result-tuples for iterable_unpacking_descent. With this change, we're down to roughly 2100,
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.
One minor comment/question, otherwise I think this is okay. I stared at it for a while, and I couldn't see any obvious problems (but I'm not sure I trust that there are none based on this! 😬).
I'm curious to see how the performance tests pan out.
I would also like to see the RA generated/executed on a large snapshot for the predicates involved (i.e. the main predicate and the two helper predicates).
result = parent_kind.getMember() | ||
or | ||
// recursive case | ||
result = taint_at_depth(parent_kind.getMember(), depth-1) |
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.
Should this have a depth > 1
constraint (so that the three disjuncts are indeed disjoint)?
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.
Fixed! This won't change the results, just the executions that's that we have to evaluate 👍
https://jenkins.internal.semmle.com/job/Changes/job/Python-Differences/33/ looks fine. Are you asking for a dist-compare besides this?
Alright. Is |
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.
This looks good. I especially like the long comment with an explanatory example, it helps put the implementation into a context of intention.
I ran I created a gist with the query logs, but that only shows the first 8 thousand lines, so you need to look at the raw results to see all 56k lines 😉 Looking at all the places it says Is this sort of what you were asking for @tausbn? -- when you said:
|
Sure,
For 1. you'll most likely want to use a recent version of VSCode, with the most recent improvements to log handling. (Or you could also just run it manually.) |
Oh, hah. I was in the process of writing my comment when you added yours. I'll take a quick look at the results. |
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.
RA and tuple counts look fine to me. Merging.
When running ql/python/ql/src/Security/CWE-079/ReflectedXss.ql against the database for flask.
Iitially there were 10 million result-tuples for iterable_unpacking_descent.
With this change, we're down to roughly 2100.
Fixes the problem introduced in #2700, and disabled in #2973