Skip to content
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

Patch for sanitizer.py needs to also be applied to _vendor/html5lib/filters/sanitizer.py #534

Closed
brosenfi opened this issue May 13, 2020 · 4 comments

Comments

@brosenfi
Copy link

brosenfi commented May 13, 2020

A patch was applied to fix CVE-2020-6817 with commit d6018f2 - however this same vulnerable regex has been identified as also occurring in bleach/_vendor/html5lib/filters/sanitizer.py (by a Sonatype "security research team" - it's in one of their advisory deviation notices).

@g-k
Copy link
Collaborator

g-k commented May 14, 2020 via email

@brosenfi
Copy link
Author

Thanks - I actually can't be credited with the good eye on this though because what triggered me to look into this issue was a failed install when the latest bleach wheel was quarantined. I actually looked before I even created this issue for a public version of Sonatype's "advisory deviation notice" (and looked again now) and can't find one. I can see the whole text on our Nexus IQ server - here's the gist of it:
The Sonatype security research team found that the needed fix in version 3.1.4 is in the bleach/sanitizer.py file, however the version contains an additional file bleach/_vendor/html5lib/filters/sanitizer.py which still has the vulnerable regex - therefore version 3.1.4 and any version that has this unpatched file will still be treated as vulnerable.
I'll raise an issue over at the html5lib project - thanks again.

@gsnedders
Copy link
Contributor

@brosenfi AFAICT you never did raise an issue, but as far as I can tell none of the regex in the sanitizer are liable to exponential backtracking (they're all maximally linear with regards to the input), and they're all just dlint-py/dlint#13.

@brosenfi
Copy link
Author

@gsnedders Yes that's correct - I got busy that day and forgot to raise it - apologies for that. Yeah reading the bug thread I don't see the same overlap with the ['"-] characters in the first group in the alternation on the html5lib version of the regex - and it's even mentioned there that it doesn't have this issue. I guess I have to go back to Sonatype and argue that this isn't actually vulnerable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants