Track vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
6.9
CVE-2021-23980: Bleach library fails to prevent XSS in certain user inputs
CVE-2021-23980 · published 3 years ago
Summary
The Bleach library has a security flaw that can allow hackers to inject malicious code into web pages. This is particularly concerning when users input data is cleaned with certain settings. If you use Bleach, make sure to check your configuration to ensure you're not vulnerable. Update to the latest version if necessary.
What to do
- Update will kahn-greene bleach to version 3.3.0.
- Update mozilla bleach to version 3.3.0 or later.
Affected software
| Ecosystem | Vendor | Product | Affected versions |
|---|---|---|---|
| pip | will kahn-greene | bleach |
< 3.3.0 Fix: upgrade to 3.3.0
|
| – | mozilla | bleach |
< 3.3.0 cpe:2.3:a:mozilla:bleach:*:*:*:*:*:*:*:* |
Original advisory text
A mutation XSS affects users calling bleach.clean with all of: svg or math in the allowed tags p or br in allowed tags style, title, noscript, script, textarea, noframes, iframe, or xmp in allowed ...
A mutation XSS affects users calling bleach.clean with all of: svg or math in the allowed tags p or br in allowed tags style, title, noscript, script, textarea, noframes, iframe, or xmp in allowed tags the keyword argument strip_comments=False Note: none of the above tags are in the default allowed tags and strip_comments defaults to True.
References
- https://github.com/mozilla/bleach/security/advisories/GHSA-vv2x-vrpj-qqpq
- https://github.com/mozilla/bleach/commit/79b7a3c5e56a09d1d323a5006afa59b56162eb1...
- https://bugzilla.mozilla.org/show_bug.cgi?id=1689399
- https://cure53.de/fp170.pdf
- https://github.com/mozilla/bleach/blob/79b7a3c5e56a09d1d323a5006afa59b56162eb13/...
- https://nvd.nist.gov/vuln/detail/CVE-2021-23980
- https://bugzilla.mozilla.org/show_bug.cgi?id=CVE-2021-23980
- https://advisory.checkmarx.net/advisory/CX-2021-4303
- https://github.com/pypa/advisory-database/tree/main/vulns/bleach/PYSEC-2021-865....
- https://pypi.org/project/bleach
- https://github.com/advisories/GHSA-vv2x-vrpj-qqpq
Internet-facing
60 days
Internal
At next upgrade
- Not known to be exploited
- Needs hands-on effort to exploit
- Gives an attacker partial control
Type
CWE-79Cross-site Scripting (XSS)
Timeline
Published16 Feb 2023
Updated4 Nov 2026
First seen6 Mar 2026
Track software like this
Free during beta