CVE-2020-6817
regular expression denial-of-service (ReDoS) in Bleach
bleach.clean behavior parsing style attributes could result in a regular expression denial of service (ReDoS). Calls to bleach.clean with an allowed tag with an allowed style attribute are vulnerable to ReDoS. For example, bleach.clean(..., attributes={'a': ['style']}).
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
7.5
bleach.clean behavior parsing style attributes could result in a regular expression denial of service (ReDoS). Calls to bleach.clean with an allowed tag with an allowed style attribute are vulnerable to ReDoS. For example, bleach.clean(..., attributes={'a': ['style']}).
- Record
CVE-2020-6817- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1333
- Updated
- 2026-11-02
CVE List
7.5
bleach.clean behavior parsing style attributes could result in a regular expression denial of service (ReDoS). Calls to bleach.clean with an allowed tag with an allowed style attribute are vulnerable to ReDoS. For example, bleach.clean(..., attributes={'a': ['style']}).
- Record
CVE-2020-6817- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1333
- Updated
- 2026-11-02
EUVDEUVD-2020-0056
7.5
bleach.clean behavior parsing style attributes could result in a regular expression denial of service (ReDoS). Calls to bleach.clean with an allowed tag with an allowed style attribute are vulnerable to ReDoS. For example, bleach.clean(..., attributes={'a': ['style']}).
- Record
EUVD-2020-0056- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-vqhp-cxgc-6wmm
8.7
regular expression denial-of-service (ReDoS) in Bleach
Impact
bleach.clean behavior parsing style attributes could result in a regular expression denial of service (ReDoS).
Calls to bleach.clean with an allowed tag with an allowed style attribute are vulnerable to ReDoS. For example, bleach.clean(..., attributes={'a': ['style']}).
Patches
3.1.4
Workarounds
-
do not whitelist the style attribute in
bleach.cleancalls -
limit input string length
References
- https://bugzilla.mozilla.org/show_bug.cgi?id=1623633
- https://www.regular-expressions.info/redos.html
- https://blog.r2c.dev/posts/finding-python-redos-bugs-at-scale-using-dlint-and-r2c/
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-6817
Credits
- Reported by schwag09 of r2c
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]
- Record
GHSA-vqhp-cxgc-6wmm- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-400, CWE-1333
- Updated
- 2026-11-02
OSV
7.5
bleach.clean behavior parsing style attributes could result in a regular expression denial of service (ReDoS). Calls to bleach.clean with an allowed tag with an allowed style attribute are vulnerable to ReDoS. For example, bleach.clean(..., attributes={'a': ['style']}).
- Record
CVE-2020-6817- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2020-6817
7.5
bleach.clean behavior parsing style attributes could result in a regular expression denial of service (ReDoS). Calls to bleach.clean with an allowed tag with an allowed style attribute are vulnerable to ReDoS. For example, bleach.clean(..., attributes={'a': ['style']}).
- Record
DEBIAN-CVE-2020-6817- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
Show 9 moreShow less
OSVGHSA-vqhp-cxgc-6wmm
8.7
regular expression denial-of-service (ReDoS) in Bleach
Impact
bleach.clean behavior parsing style attributes could result in a regular expression denial of service (ReDoS).
Calls to bleach.clean with an allowed tag with an allowed style attribute are vulnerable to ReDoS. For example, bleach.clean(..., attributes={'a': ['style']}).
Patches
3.1.4
Workarounds
-
do not whitelist the style attribute in
bleach.cleancalls -
limit input string length
References
- https://bugzilla.mozilla.org/show_bug.cgi?id=1623633
- https://www.regular-expressions.info/redos.html
- https://blog.r2c.dev/posts/finding-python-redos-bugs-at-scale-using-dlint-and-r2c/
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-6817
Credits
- Reported by schwag09 of r2c
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]
- Record
GHSA-vqhp-cxgc-6wmm- CVSS 4.0
- 8.7 High
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N - CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1333, CWE-400
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2020-6817
7.5
bleach.clean behavior parsing style attributes could result in a regular expression denial of service (ReDoS). Calls to bleach.clean with an allowed tag with an allowed style attribute are vulnerable to ReDoS. For example, bleach.clean(..., attributes={'a': ['style']}).
- Record
UBUNTU-CVE-2020-6817- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVMGASA-2020-0176 No score
Updated python-bleach packages fix security vulnerability
In Mozilla Bleach before 3.12, a mutation XSS in bleach.clean when RCDATA and either svg or math tags are whitelisted and the keyword argument strip=False. (CVE-2020-6816)
Regular expression denial of service. (CVE-2020-6817)
- Record
MGASA-2020-0176- Updated
- 2026-11-02
OSVopenSUSE-SU-2021:0552-1 No score
Security update for python-bleach
This update for python-bleach fixes the following issues:
- CVE-2021-23980: Fixed mutation XSS on bleach.clean with specific combinations of allowed tags (boo#1184547)
Update to 3.1.5:
- replace missing
setuptoolsdependency withpackaging. Thank you Benjamin Peterson.
Update to 3.1.4 (boo#1168280, CVE-2020-6817):
bleach.cleanbehavior parsing style attributes could result in a regular expression denial of service (ReDoS). Calls tobleach.cleanwith an allowed tag with an allowedstyleattribute were vulnerable to ReDoS. For example,bleach.clean(..., attributes={'a': ['style']}).- Style attributes with dashes, or single or double quoted values are cleaned instead of passed through.
update to 3.1.3 (boo#1167379, CVE-2020-6816):
- Add relative link to code of conduct. (#442)
- Drop deprecated 'setup.py test' support. (#507)
- Fix typo: curren -> current in tests/test_clean.py (#504)
- Test on PyPy 7
- Drop test support for end of life Python 3.4
bleach.cleanbehavior parsing embedded MathML and SVG content with RCDATA tags did not match browser behavior and could result in a mutation XSS. Calls tobleach.cleanwithstrip=Falseandmathorsvgtags and one or more of the RCDATA tagsscript,noscript,style,noframes,iframe,noembed, orxmpin the allowed tags whitelist were vulnerable to a mutation XSS.
- Record
openSUSE-SU-2021:0552-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2021:0571-1 No score
Security update for python-bleach
This update for python-bleach fixes the following issues:
- CVE-2021-23980: Fixed mutation XSS on bleach.clean with specific combinations of allowed tags (boo#1184547)
Update to 3.1.5:
- replace missing
setuptoolsdependency withpackaging. Thank you Benjamin Peterson.
Update to 3.1.4 (boo#1168280, CVE-2020-6817):
bleach.cleanbehavior parsing style attributes could result in a regular expression denial of service (ReDoS). Calls tobleach.cleanwith an allowed tag with an allowedstyleattribute were vulnerable to ReDoS. For example,bleach.clean(..., attributes={'a': ['style']}).- Style attributes with dashes, or single or double quoted values are cleaned instead of passed through.
update to 3.1.3 (boo#1167379, CVE-2020-6816):
- Add relative link to code of conduct. (#442)
- Drop deprecated 'setup.py test' support. (#507)
- Fix typo: curren -> current in tests/test_clean.py (#504)
- Test on PyPy 7
- Drop test support for end of life Python 3.4
bleach.cleanbehavior parsing embedded MathML and SVG content with RCDATA tags did not match browser behavior and could result in a mutation XSS. Calls tobleach.cleanwithstrip=Falseandmathorsvgtags and one or more of the RCDATA tagsscript,noscript,style,noframes,iframe,noembed, orxmpin the allowed tags whitelist were vulnerable to a mutation XSS.
This update was imported from the openSUSE:Leap:15.2:Update update project.
- Record
openSUSE-SU-2021:0571-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:11219-1 No score
python36-bleach-3.3.0-1.4 on GA media
These are all security issues fixed in the python36-bleach-3.3.0-1.4 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:11219-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:14134-1 No score
python310-bleach-6.1.0-1.5 on GA media
These are all security issues fixed in the python310-bleach-6.1.0-1.5 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:14134-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:11323-1 No score
python313-bleach-6.4.0-1.1 on GA media
These are all security issues fixed in the python313-bleach-6.4.0-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:11323-1- Updated
- 2026-11-02
OSVPYSEC-2020-340 No score
In Mozilla Bleach before 3.1.4, bleach.clean behavior parsing style attributes could result in a regular expression denial of service (ReDoS).
- Record
PYSEC-2020-340- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
bleachPyPI |
before 3.1.4 | 3.1.4 |
python-bleachDebian:12 |
before 3.1.4-1 | 3.1.4-1 |
python-bleachDebian:13 |
before 3.1.4-1 | 3.1.4-1 |
python-bleachDebian:14 |
before 3.1.4-1 | 3.1.4-1 |
python-bleachDebian:8 |
before 1.4-1+deb8u1, plus listed versions 1.4-1 |
1.4-1+deb8u1 |
bleachPyPI |
before 3.1.4, plus listed versions 0.10.1.10.1.20.20.2.1 Show 39 moreShow less0.2.20.30.3.10.3.30.3.40.5.00.5.11.0.01.0.11.0.21.0.31.0.41.1.01.1.11.1.21.1.31.1.41.1.51.21.2.11.2.21.41.4.11.4.21.4.31.5.02.0.02.12.1.12.1.22.1.32.1.43.0.03.0.13.0.23.1.03.1.13.1.23.1.3 |
3.1.4 |
python-bleachMageia:7 From an advisory covering 2 CVEs |
before 3.1.4-1.mga7 | 3.1.4-1.mga7 |
python-bleachUbuntu:Pro:16.04:LTS |
before 1.4.2-1ubuntu0.1~esm1, plus listed versions 1.4-11.4.2-1 |
1.4.2-1ubuntu0.1~esm1 |
python-bleachUbuntu:Pro:18.04:LTS |
before 2.1.2-1ubuntu0.1~esm1, plus listed versions 2.0-12.1.2-1 |
2.1.2-1ubuntu0.1~esm1 |
python-bleachUbuntu:Pro:20.04:LTS |
before 3.1.1-1ubuntu0.1~esm1, plus listed versions 3.1.0-13.1.0-23.1.1-1 |
3.1.1-1ubuntu0.1~esm1 |
Show 4 moreShow less
| Package | Affected | Fixed |
|---|---|---|
python-bleachopenSUSE:Leap 15.2 From an advisory covering 3 CVEs |
before 3.1.5-lp152.2.3.1 | 3.1.5-lp152.2.3.1 |
python-bleachSUSE:Package Hub 15 SP2 From an advisory covering 3 CVEs |
before 3.1.5-bp152.2.4.1 | 3.1.5-bp152.2.4.1 |
python-bleachopenSUSE:Tumbleweed From an advisory covering 5 CVEs |
before 6.1.0-1.5 | 6.1.0-1.5 |
python-bleachopenSUSE:Tumbleweed From an advisory covering 5 CVEs |
before 6.4.0-1.1 | 6.4.0-1.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2020-6817 is a high vulnerability (CVSS 7.5) in Mozilla Bleach, published March 30, 2020. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.72%, the 54th percentile. Fixed in bleach 3.1.4.
References
github.com/mozilla/bleach/security/advisories/GHSA-vqhp-cxgc-6wmm
bugzilla.mozilla.org/show_bug.cgi?id=1623633
github.com/mozilla/bleach/releases/tag/v3.1.4
nvd.nist.gov/vuln/detail/CVE-2020-6817
snyk.io/vuln/SNYK-PYTHON-BLEACH-561754
github.com/pypa/advisory-database/tree/main/vulns/bleach/PYSEC-2020-340.yaml
Show 24 moreShow less
github.com/advisories/GHSA-vqhp-cxgc-6wmm
security-tracker.debian.org/tracker/CVE-2020-6817
github.com/mozilla/bleach
advisories.mageia.org/MGASA-2020-0176.html
bugs.mageia.org/show_bug.cgi?id=26445
debian.org/security/2020/dsa-4643
debian.org/lts/security/2020/dla-2167
bugs.mageia.org/show_bug.cgi?id=26379
blog.r2c.dev/posts/finding-python-redos-bugs-at-scale-using-dlint-and-r2c
ubuntu.com/security/CVE-2020-6817
github.com/mozilla/bleach/commit/d6018f2539d271963c3e7f54f36ef11900363c69
github.com/mozilla/bleach/commit/6e74a5027b57055cdaeb040343d32934121392a7
cve.org/CVERecord?id=CVE-2020-6817
ubuntu.com/security/notices/USN-8077-1
lists.opensuse.org/archives/list/[email protected]/thread/YFAKMJGUZHUTZ53ZAID6PRVP5MSLXPGV
bugzilla.suse.com/1167379
bugzilla.suse.com/1168280
bugzilla.suse.com/1184547
suse.com/security/cve/CVE-2020-6816
suse.com/security/cve/CVE-2020-6817
suse.com/security/cve/CVE-2021-23980
lists.opensuse.org/archives/list/[email protected]/thread/UAZHEWM4ZYBZY5GDDDOMIZYEGFNANLKS
suse.com/security/cve/CVE-2018-7753
suse.com/security/cve/CVE-2020-6802