All vulnerabilities

PyPI

CVE-2026-129295

mail-parser is vulnerable to polynomial ReDoS in email header parsing

Severity
High 7.5
Published
16 Nov 2026
Last changed
16 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
4.6.1
Exploit chance
0.5% in the next 30 daysHigher than 43% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Regular expression denial of service (ReDoS) (CWE-1333)
Attack
Over the network · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Also known as
GHSA-r7w7-vpq8-c5vv
Sources
OSV.dev and GitHub

Description

Two regular expressions used while parsing email headers backtrack polynomially on attacker-controlled input. Parsing a single small, well-formed email can consume minutes to hours of CPU, denying service to any process that parses untrusted mail.

Both are reachable from an ordinary parse_from_string(), parse_from_bytes() or parse_from_file() call — no special API, option, or malformed structure is required by the victim.

get_addresses() falls back to _ADDR_FALLBACK_RE whenever email.utils.getaddresses(strict=True) yields no usable address. The alternative ([^<,]?)\s<([^>]+)> overlaps a lazy quantifier with an adjacent \s* — a space matches both. Driven by finditer, which retries at every offset and rescans the remainder, matching degrades to quadratic on < padding and cubic on whitespace padding.

The fallback engages on the feature's own happy path, e.g. From: [email protected] .

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

None within the library. Upgrade to 4.6.1.

Users who cannot upgrade immediately should cap total header size before parsing and enforce a wall-clock timeout around each parse.

Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
mail-parserPyPI · osv:PyPI:mail-parser
  • From 4.2.0 before 4.6.1

About mail-parser

Weekly downloads (PyPI)
1,447,533PyPI Stats, 24 Nov 2026

References