Mozilla Bleach ReDoS in linkify with parse_email enabled

Severity: medium · CVSS 4.3 · Published 2026-06-16

Bleach is a Python library used to clean and sanitize untrusted HTML text, often used in web applications to process user comments or profiles. A flaw in its optional email-linking feature allows an attacker to submit specially crafted text that causes the server to consume excessive CPU resources. This can lead to a denial-of-service condition where the application becomes slow or unresponsive to other users.

Technologies: bleach (PyPI). Vendors: PyPI.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Medium severity, with a CVSS score of 4.3, published 16 June 2026.
Which products and versions are affected?
bleach (PyPI) = 6.3.0.
Is there a fix for This vulnerability?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is This vulnerability attacked?
It is attacked over the network, in a software library.
Am I affected?
Check whether you run bleach (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The vulnerability is a Regular Expression Denial of Service (ReDoS) (CWE-1333) located in 'bleach/linkifier.py'. When 'parse_email=True' is passed to 'bleach.linkify()', the 'EMAIL_RE' regular expression is applied to user-controlled text via 'finditer()'. The regex contains a repeated dot-atom pattern that exhibits superlinear complexity when processing long strings of repeated segments (e.g., 'a.a.a...') that do not contain an '@' symbol. An attacker can exploit this by submitting a payload of approximately 30 KB, causing multi-second CPU hangs per request. No patch was available at the time of the advisory.

Affected products

  • Mozilla bleach 6.3.0

Timeline

  • 2026-06-05: disclosed
  • 2026-06-16: advisory

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.