# CVE-2026-129295: mail-parser is vulnerable to polynomial ReDoS in email header parsing

> A small crafted email with malicious headers can trigger quadratic regex backtracking in mail-parser, hanging mail gateways or ticketing workers.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Harmful if only installed:** No
- **Needs a specific call:** No
- **Fix available:** Yes
- **Published:** 16 Nov 2026
- **Updated:** 17 Nov 2026
- **Also known as:** GHSA-r7w7-vpq8-c5vv

## What is CVE-2026-129295?

CVE-2026-129295 is a high-severity denial of service vulnerability in SpamScope mail-parser, published on 16 Nov 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

mail-parser is a tool that parses emails by enhancing the Python standard library and extracting message details into a comprehensive object. From 4.2.0 until 4.6.1, attacker-controlled email headers can cause polynomial regular-expression backtracking during ordinary parse_from_string(), parse_from_bytes(), or parse_from_file() calls. In src/mailparser/utils.py, get_addresses() invokes the _ADDR_FALLBACK_RE fallback when strict address parsing yields no usable address, and overlapping quantifiers rescan padded address headers quadratically or cubically. In src/mailparser/const.py, parse_received() applies _CLAUSE_SPLITTER to uncollapsed whitespace in a Received header, causing quadratic backtracking when a whitespace run is not followed by a clause keyword. A small, well-formed message can keep mail gateway, ticketing, quarantine, or archival parsing workers busy for extended periods. This issue is fixed in version 4.6.1.

Weakness: CWE-1333 (Inefficient Regular Expression Complexity)

## Which versions are affected by CVE-2026-129295?

1 open source package ship an affected version, including mail-parser.

An affected version is exposed as installed. No special setting or call is needed.


| Package | Ecosystem | PURL | Affected | Fixed in |
| --- | --- | --- | --- | --- |
| `mail-parser` | PyPI | `pkg:pypi/mail-parser` | From 4.2.0 | 4.6.1 |

Status by vendor (upstream, then each distribution release and vendor build):

| Who | Release | Status | Packages | Fixed in |
| --- | --- | --- | --- | --- |
| Upstream |  | fixed | `mail-parser` | 4.6.1 |

## How do I fix CVE-2026-129295?

Upgrade mail-parser to 4.6.1 or later.

## Is CVE-2026-129295 being exploited?

There is no known exploitation of CVE-2026-129295 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-129295 and fix it if it is affected.

What it is: CVE-2026-129295 is a high-severity denial of service vulnerability in SpamScope mail-parser, published on 16 Nov 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-129295 in the wild and no public exploit code.
Exposure: An affected version is exposed as installed. No special setting or call is needed.

Affected packages and fixed versions:
- mail-parser (PyPI): affected from 4.2.0; fixed in 4.6.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-129295/ (Markdown: https://insights.sbomify.com/CVE-2026-129295/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-129295
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-129295
- OSV: https://osv.dev/vulnerability/CVE-2026-129295

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-129295/
Summaries are generated and may contain mistakes; the official description above is the record.
