CVE-2026-129295: mail-parser is vulnerable to polynomial ReDoS in email header parsing
Published 2026-11-16 · Updated 2026-11-16 · Also known as GHSA-r7w7-vpq8-c5vv
Summary
mail-parser contains polynomial-time regex backtracking in its email header parsing (CVE-2026-129295), letting a small crafted email consume excessive CPU and deny service. Anyone using PyPI mail-parser 4.2.0 through 4.6.0 to parse untrusted email should upgrade to 4.6.1.
Who is affected
Any process that parses untrusted email with mail-parser, such as mail gateways, ticketing systems, quarantine UIs, and archiving pipelines, is affected on versions 4.2.0 to 4.6.0. A single small, well-formed, RFC 5322-compliant email (including fully compliant folded headers) is sufficient to trigger the backtracking, with no special API, option, or malformed structure required, and all six address headers plus Received parsing add up. A handful of such emails can keep every parsing worker busy, denying service. Impact is limited to availability, with no confidentiality or integrity effect.
Exploitability
The CVSS 3.1 vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H yields a base score of 7.5, reflecting a network-reachable attack that is low complexity, requires no privileges and no user interaction, and affects availability only. EPSS is 0.005 (0.5% probability, percentile 0.432), indicating relatively low short-term exploitation likelihood. It is not listed in the CISA Known Exploited Vulnerabilities catalog, so active exploitation is not documented.
Remediation
- Upgrade PyPI mail-parser to version 4.6.1, which replaces both vulnerable regexes with linear-time implementations.
- If you cannot upgrade immediately, cap total header size before parsing and enforce a wall-clock timeout around each parse call, since no workaround exists within the library itself.
How to check your project
- Check the installed or pinned mail-parser version in your dependency manifest or lockfile (for example via your package manager) and treat any version introduced at 4.2.0 and below 4.6.1 as affected.
- Confirm the fixed version 4.6.1 is present; the vulnerable behavior lives in get_addresses() in src/mailparser/utils.py and parse_received() in src/mailparser/const.py, so reviews of local forks or patches of these files should verify the linear-time fixes are applied.
Automated analysis of the published advisory data, generated 2026-11-18. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| PyPI | mail-parser |
>= 4.2.0, < 4.6.1 | 4.6.1 | python -m pip install 'mail-parser>=4.6.1' |
CVSS 3.1 vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
| Attack vector | Network |
|---|---|
| Attack complexity | Low |
| Privileges required | None |
| User interaction | None |
| Scope | Unchanged |
| Confidentiality | None |
| Integrity | None |
| Availability | High |
FAQ
Is CVE-2026-129295 being actively exploited?
No. It is not listed in the CISA Known Exploited Vulnerabilities catalog, and no active exploitation is documented in this record.
What is the impact beyond denial of service?
None is documented. The flaw affects availability only (C:N/I:N in the CVSS vector); there is no confidentiality or integrity impact.
Which mail-parser versions are affected and where is it fixed?
The vulnerability was introduced in 4.2.0 and fixed in 4.6.1, so versions from 4.2.0 up to (but not including) 4.6.1 are affected. Upgrade to 4.6.1.
Is there a workaround if I cannot upgrade to 4.6.1?
The record states there is no workaround within the library. Users who cannot upgrade should cap total header size before parsing and enforce a wall-clock timeout around each parse.
Original advisory description
References
- WEB https://github.com/SpamScope/mail-parser/security/advisories/GHSA-r7w7-vpq8-c5vv
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-129295
- WEB https://github.com/SpamScope/mail-parser/pull/166
- WEB https://github.com/SpamScope/mail-parser/commit/037293158cb291caa96635a54449243d32cd4d96
- WEB https://github.com/SpamScope/mail-parser/commit/5aab122f0d763991604d2c2bcc807c6bf2489464
- WEB https://github.com/SpamScope/mail-parser/commit/85e53f820d78ae7c955dafbbcd0e20989a735c2c
- PACKAGE https://github.com/SpamScope/mail-parser
- WEB https://github.com/SpamScope/mail-parser/releases/tag/4.6.1
Source records: GHSA-r7w7-vpq8-c5vv (OSV.dev) · EPSS by FIRST, 2026-11-26.