{"id":"CVE-2020-6817","aliases":["CVE-2020-6817","GHSA-vqhp-cxgc-6wmm","PYSEC-2020-340","SNYK-PYTHON-BLEACH-561754"],"related":[],"kind":"vulnerability","state":"published","title":"regular expression denial-of-service (ReDoS) in Bleach","summary":"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']}).","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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']}).","source":"cvelist"},{"lang":"en","text":"### Impact\n\n`bleach.clean` behavior parsing style attributes could result in a regular expression denial of service (ReDoS).\n\nCalls to ``bleach.clean`` with an allowed tag with an allowed ``style`` attribute are vulnerable to ReDoS. For example, ``bleach.clean(..., attributes={'a': ['style']})``.\n\n### Patches\n\n3.1.4\n\n### Workarounds\n\n* do not whitelist the style attribute in `bleach.clean` calls\n\n* limit input string length\n\n### References\n\n* https://bugzilla.mozilla.org/show_bug.cgi?id=1623633\n* https://www.regular-expressions.info/redos.html\n* https://blog.r2c.dev/posts/finding-python-redos-bugs-at-scale-using-dlint-and-r2c/\n* https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-6817\n\n### Credits\n\n* Reported by schwag09 of r2c\n\n### For more information\nIf you have any questions or comments about this advisory:\n\n* Open an issue at https://github.com/mozilla/bleach/issues\n* Email us at security@mozilla.org","format":"markdown","source":"ghsa"},{"lang":"es","text":"Los atributos de estilo de análisis del comportamiento de bleach.clean podrían dar como resultado una denegación de servicio de expresión regular (ReDoS). Las llamadas a blanqueador.clean con una etiqueta permitida con un atributo de estilo permitido son vulnerables a ReDoS. Por ejemplo, blanqueador.clean(..., atributos={'a': ['estilo']}).","source":"nvd"},{"lang":"en","text":"In Mozilla Bleach before 3.1.4, `bleach.clean` behavior parsing style attributes could result in a regular expression denial of service (ReDoS).","format":"markdown","source":"pysec"}],"published":"2020-03-30T19:45:00.000Z","modified":"2026-09-10T03:48:29.583Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-400","CWE-1333"],"affected":[{"ranges":[{"type":"custom","introduced":"unspecified","fixed":"3.1.4","status":"affected"}],"vendor":"Mozilla","product":"Mozilla Bleach","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.1.4"}],"ecosystem":"PyPI","package":"bleach","purl":"pkg:pypi/bleach","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.1.4"}],"vendor":"mozilla","product":"bleach","cpe":"cpe:2.3:a:mozilla:bleach:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.1.4"}],"ecosystem":"PyPI","package":"bleach","purl":"pkg:pypi/bleach","source":"pysec"}],"references":[{"url":"https://github.com/mozilla/bleach/security/advisories/GHSA-vqhp-cxgc-6wmm","tags":["advisory","vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://bugzilla.mozilla.org/show_bug.cgi?id=1623633","tags":["exploit","issue-tracking","report","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-6817","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/mozilla/bleach","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/mozilla/bleach/releases/tag/v3.1.4","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/bleach/PYSEC-2020-340.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://snyk.io/vuln/SNYK-PYTHON-BLEACH-561754","tags":["advisory","web"],"sources":["ghsa","pysec"]},{"url":"https://blog.r2c.dev/posts/finding-python-redos-bugs-at-scale-using-dlint-and-r2c/","tags":["article"],"sources":["pysec"]}],"credits":[],"assigner":"mozilla","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2025-03-19T15:21:19.285Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-6817","url":"https://www.cve.org/CVERecord?id=CVE-2020-6817","licence":"CVE Terms of Use","modified":"2025-03-19T15:21:23.888Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vqhp-cxgc-6wmm","url":"https://github.com/advisories/GHSA-vqhp-cxgc-6wmm","licence":"CC-BY-4.0","modified":"2026-09-10T03:48:29.583Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-6817","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-6817","licence":"Public domain","modified":"2026-06-17T03:23:51.673Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2020-340","url":"https://osv.dev/vulnerability/PYSEC-2020-340","licence":"CC-BY-4.0","modified":"2023-11-08T04:03:57.176Z"}],"updatedAt":"2026-11-25T22:57:58.812Z","epss":{"score":0.00726,"percentile":0.55344,"date":"2026-12-01T12:00:22.000Z"}}