bleach

An easy safelist-based HTML-sanitizing tool.

6.4.0Latest, 5 Jun 2026
75MDownloads, last month
0Advisories on the latest
13Advisories, all versions
Apache Software LicenseLicence
2.8KStars
4.9/10OpenSSF Scorecard

Known advisories

Severity Advisory Fix Published
Low Bleach: URI sanitization allows disallowed URI schemes with Unicode > U+00A0 in output GHSA-8rfp-98v4-mmr6 Fixed in 6.4.0 16 Jun 2026
Moderate Bleach linkify(parse_email=True) CPU exhaustion via unbounded email regex scanning GHSA-g75f-g53v-794x No fix listed 16 Jun 2026
Moderate Bleach clean() / Cleaner() fails to sanitize dangerous URI schemes in allowed formaction attributes GHSA-gj48-438w-jh9v Fixed in 6.4.0 16 Jun 2026
Moderate Cross-site scripting in Bleach CVE-2021-23980 Fixed in 3.3.0 2 Feb 2021
PYSEC-2021-865 CVE-2021-23980 Fixed in 3.3.0 2 Feb 2021
High regular expression denial-of-service (ReDoS) in Bleach CVE-2020-6817 Fixed in 3.1.4 30 Mar 2020
PYSEC-2020-340 CVE-2020-6817 Fixed in 3.1.4 30 Mar 2020
Moderate Bleach vulnerable to mutation XSS via whitelisted math or svg and raw tag CVE-2020-6816 Fixed in 3.1.2 24 Mar 2020
PYSEC-2020-27 CVE-2020-6802 Fixed in 3.1.1 24 Mar 2020
PYSEC-2020-28 CVE-2020-6816 Fixed in 3.1.2 24 Mar 2020
Moderate XSS in Bleach when noscript and raw tag whitelisted CVE-2020-6802 Fixed in 3.1.1 24 Feb 2020
Critical Bleach URI Scheme Restriction Bypass CVE-2018-7753 Fixed in 2.1.3 4 Jan 2019
PYSEC-2018-51 CVE-2018-7753 Fixed in 2.1.3 7 Mar 2018

In the news

On Hacker News

Sources: PyPI, deps.dev (CC BY 4.0), OSV. Last checked 4 Dec 2026.