CVE-2021-23980 json
Cross-site scripting in Bleach
published 5y ago modified 4mo ago also GHSA-vv2x-vrpj-qqpq , PYSEC-2021-865 , EUVD-2021-0036
- cvss
- 6.1
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.5%
- EPSS 0.5% chance of exploitation in 30 days, percentile 41%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi bleach 3.3.0
- Mozilla Mozilla Bleach 3.3.0
- python-bleach Debian 14, Debian 13, Debian 12 3.2.1-2.1
debian advisories DEBIAN-CVE-2021-23980
- python-bleach Ubuntu Pro 16.04 LTS 1.4.2-1ubuntu0.1~esm1
- python-bleach Ubuntu Pro 18.04 LTS 2.1.2-1ubuntu0.1~esm1
- python-bleach Ubuntu Pro 20.04 LTS 3.1.1-1ubuntu0.1~esm1
ubuntu advisories UBUNTU-CVE-2021-23980
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- python-bleach ansible automation platform 4.2 3.3.0-1.el7pc
- python-bleach ansible automation platform 4.2 3.3.0-1.el8pc
- automation-hub ansible automation platform 4.2 4.2.2-1.el7pc
- automation-hub ansible automation platform 4.2 4.2.2-1.el8pc
- python3-bleach ansible automation platform 4.2 3.3.0-1.el7pc
- python3-bleach ansible automation platform 4.2 3.3.0-1.el8pc
- python3-django ansible automation platform 4.2 2.2.18-1.el7pc
- python3-django ansible automation platform 4.2 2.2.18-1.el8pc
red hat advisories RHSA-2021:0781
- python-bleach openSUSE Tumbleweed 6.4.0-1.1
- python-bleach openSUSE Tumbleweed 6.1.0-1.5
- python-bleach Package Hub 15 SP2 3.1.5-bp152.2.4.1
- python-bleach openSUSE Leap 15.2 3.1.5-lp152.2.3.1
opensuse advisories openSUSE-SU-2026:11323-1openSUSE-SU-2024:14134-1openSUSE-SU-2021:0571-1openSUSE-SU-2021:0552-1
- py3-bleach Alpine 3.24, Alpine 3.23, Alpine 3.22 +7 more 3.3.0-r0
alpine advisories ALPINE-CVE-2021-23980
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Is CVE-2021-23980 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerVendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-23980 updated cvss 6.1
python-bleach: Mutation cross-site scripting in bleach.clean
-
Red Hat Automation Hub 4.2 for RHEL 7 python-bleach 3.3.0-1.el7pc, automation-hub 4.2.2-1.el7pc, python3-bleach 3.3.0-1.el7pc, python3-django 2.2.18-1.el7pc, python-galaxy-ng 4.2.2-1.el7pc, python3-galaxy-ng 4.2.2-1.el7pc, +6 more Red Hat Automation Hub 4.2 for RHEL 8 python-bleach 3.3.0-1.el8pc, automation-hub 4.2.2-1.el8pc, python3-bleach 3.3.0-1.el8pc, python3-django 2.2.18-1.el8pc, python-galaxy-ng 4.2.2-1.el8pc, python3-galaxy-ng 4.2.2-1.el8pc, +6 morefixed: vendor fix RHSA-2021:0781
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- partial
- Assessed
- last yr.
Exploit prediction
0.48% chance of exploitation in the next 30 days, higher than 41% of all scored CVEs (FIRST EPSS, 2026-11-09).
Exploits and checks
- bugzilla.mozilla.org https://bugzilla.mozilla.org/show_bug.cgi?id=CVE-2021-23980 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| CNA | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| GitHub | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | bleach | <3.3.0 |
3.3.0 |
Affected products
- Mozilla Mozilla Bleach
Classification
- Weakness
-
- CWE-79 Improper Neutralization of Input During Web Page Generation
References
-
github.com
/mozilla/bleach/commit/79b7a3c5e56a09d1d323a5006afa59b56162eb13
web, patch
-
bugzilla.mozilla.org
/show_bug.cgi?id=CVE-2021-23980
web, exploit, issue-tracking
-
github.com
/mozilla/bleach/security/advisories/GHSA-vv2x-vrpj-qqpq
web, vendor-advisory, advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-23980
advisory
-
advisory.checkmarx.net
/advisory/CX-2021-4303
web, advisory
-
bugzilla.mozilla.org
/show_bug.cgi?id=1689399
web
-
cure53.de
/fp170.pdf
web
-
github.com
/mozilla/bleach
package
-
github.com
/mozilla/bleach/blob/79b7a3c5e56a09d1d323a5006afa59b56162eb13/CHANGES#L4
web
-
github.com
/pypa/advisory-database/tree/main/vulns/bleach/PYSEC-2021-865.yaml
web
-
pypi.org
/project/bleach
web
Sources
- CVE List CVE-2021-23980
- GitHub Advisory GHSA-vv2x-vrpj-qqpq
- NVD CVE-2021-23980
- OSV PYSEC-2021-865
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.