-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Python: Propagate taint through parse_qs #3311
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
Conversation
This all looks good. I take it that we were unable to track taint through the definitions of any of these things, or if we could, it wasn't enough b/c of not being able to analyze certain imports, etc.? Could be useful to add a node why it's necessary to special case this as a taint source instead of just the URL itself and propagating from there. |
What an excellent question! I did not think about it, simply found that we didn't propagate taint properly, and made a fix. So I looked over the If that was solved the taint would stop because we currently don't propagate taint through Once these two problems have been fixed, it would be interesting to see if we can handle this case out-of-the-box without any special handling. |
No matter what, we should also handle |
Since this test inheriently has `--max-import-depth=1`, by using six, we would never look at the actual source-code of urllib.parse/urlparse and therefore the test would never show if we understood the library code good enough that we could propagate taint out-of-the-box. All tests moved by one line... that is why the diff is so big
After adding support for In conclusion, for now, we need both of these special cases. |
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 comment, otherwise LGTM.
Encountered this in Gruyere. It was not essential to anything, but we should handle it none the less.
reference: https://docs.python.org/3.8/library/urllib.parse.html#urllib.parse.parse_qs