bleach
Affected
- introduced
0, fixed3.3.0(ecosystem)
Fixed versions
3.3.0
Fix
- Fixed version
3.3.0pip install --upgrade bleach==3.3.0
Advisory
Also known as: CVE-2021-23980, PYSEC-2021-865
Cross-site scripting in Bleach
Impact
A mutation XSS affects users calling bleach.clean with all of:
svg or math in the allowed tagsp or br in allowed tagsstyle, title, noscript, script, textarea, noframes, iframe, or xmp in allowed tagsstrip_comments=FalseNote: none of the above tags are in the default allowed tags and strip_comments defaults to True.
Patches
Users are encouraged to upgrade to bleach v3.3.0 or greater.
Note: bleach v3.3.0 introduces a breaking change to escape HTML comments by default.
Workarounds
bleach.clean calls to at least one of:style, title, noscript, script, textarea, noframes, iframe, or xmp tagsvg or math tagsp or br tagsstrip_comments=Trueunsafe-inline and unsafe-eval `script-src`s) will also help mitigate the risk.References
Credits
For more information
If you have any questions or comments about this advisory:
Medium Basis: The source's own band: MODERATE
0, fixed 3.3.0 (ecosystem)3.3.0
3.3.0pip install --upgrade bleach==3.3.0Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0