CVE-2020-6802 is a medium-severity (CVSS 6.1) Cross-site Scripting (XSS) vulnerability in bleach. 2 public exploit references exist, so weaponization risk is real. A fix is available for bleach — see the affected versions and patch details below.
XSS in Bleach when noscript and raw tag whitelisted
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2020-6802 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 397,508 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
bleachReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Impact
A mutation XSS affects users calling bleach.clean with noscript and a raw tag (see below) in the allowed/whitelisted tags option.
Patches
v3.1.1
Workarounds
- modify
bleach.cleancalls to not whitelistnoscriptand one or more of the following raw tags:
title
textarea
script
style
noembed
noframes
iframe
xmp
- A strong Content-Security-Policy without
unsafe-inlineandunsafe-evalscript-srcs) will also help mitigate the risk.
References
- https://bugzilla.mozilla.org/show_bug.cgi?id=1615315
- https://cure53.de/fp170.pdf
- https://nvd.nist.gov/vuln/detail/CVE-2020-6802
- https://www.checkmarx.com/blog/vulnerabilities-discovered-in-mozilla-bleach
Credits
- Reported by Yaniv Nizry from the CxSCA AppSec group at Checkmarx
For more information
If you have any questions or comments about this advisory:
- Open an issue at https://github.com/mozilla/bleach/issues
- Email us at [email protected]
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | bleach | all versions | 3.1.1pip install --upgrade 'bleach==3.1.1' |
Affected Products
fedorafedoraprojectbleachmozillaResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for bleach, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update bleach to 3.1.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2020-6802 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Frequently Asked Questions
Is CVE-2020-6802 in your dependencies?
Find it across PyPI, including transitive dependencies.