PyPI
CVE-2026-129301
mail-parser: One hostile attachment aborts `write_attachments()` and silently drops the rest of the batch
- Severity
- Medium 6.5
- Published
- 16 Nov 2026
- Last changed
- 16 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 4.6.3
- Exploit chance
- 0.3% in the next 30 daysHigher than 27% of CVEs. EPSS by FIRST, 24 Nov 2026
- Attack
- Over the network · No login needed · No user action needed
- Attacker can
- Change some data · Slow it down
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L- Also known as
- GHSA-8cgq-x343-p74c
- Sources
- OSV.dev and GitHub
Description
write_attachments() called _safe_attachment_filename() and write_sample() inside its loop with no guard, so a single crafted attachment raised out of the whole save. Every attachment after the malicious one was silently never written, with no error surfaced to a caller that catches only MailParserError.
That is an evasion primitive as much as an availability bug: a sender puts one poisoned part first and the real payload second, and the payload never reaches the extraction directory that a downstream scanner or sandbox reads — while it still reaches the recipient's mail client intact. The tool's output diverges from the bytes actually in the message, which is the same failure mode as the filename-sanitizing bypass in GHSA-fr3h-cpq2-9496.
Three shapes were reachable, all from attacker-controlled MIME metadata:
- NUL smuggled through RFC 2231 — filename*=us-ascii''evil%00.bin decodes to a NUL in the filename during parsing and raised ValueError out of the name check;
- overlong…
Workarounds
Upgrade to 4.6.3. If you cannot upgrade, do not call write_attachments() on untrusted mail; iterate parser.attachments yourself and write each attachment inside its own try/except Exception, skipping the ones whose safe_filename is None.
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-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-129295mail-parser is vulnerable to polynomial ReDoS in email header parsingHigh 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-129301
- GitHub Advisory Database https://github.com/advisories/GHSA-8cgq-x343-p74c