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
- 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] .
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.
Affected software
| Software | Affected versions |
|---|---|
mail-parserPyPI · osv:PyPI:mail-parser |
|
About mail-parser
- Weekly downloads (PyPI)
- 1,447,533PyPI Stats, 24 Nov 2026
Vulnerabilities in mail-parser
- In our list
- 6
- Published in the last 12 months
- 6
- Critical, last 12 months
- 0
- High, last 12 months
- 2
- Known exploited
- 0
- CVE-2026-129301mail-parser: One hostile attachment aborts `write_attachments()` and silently drops the rest of the batchMedium 6.5 16 Nov 2026
- CVE-2026-129300mail-parser: Uncaught `OverflowError` / `OSError` on an out-of-range `Received` dateMedium 5.3 16 Nov 2026
- CVE-2026-129299mail-parser: Uncaught exceptions and silent header loss in mail-parser on attacker-controlled inputMedium 6.5 16 Nov 2026
- CVE-2026-129297mail-parser: Sender IP address spoofing in get_server_ipaddress()High 7.5 16 Nov 2026
- CVE-2026-129296mail-parser: Path Traversal vulnerability in attachment extractionMedium 6.5 16 Nov 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-129295
- GitHub Advisory Database https://github.com/advisories/GHSA-r7w7-vpq8-c5vv