CVE-2026-129301: mail-parser: One hostile attachment aborts `write_attachments()` and silently drops the rest of the batch
Published 2026-11-16 · Updated 2026-11-16 · Also known as GHSA-8cgq-x343-p74c
Summary
The mail-parser package fails to catch exceptions raised during attachment writes in versions 4.6.0 through 4.6.2, causing a single hostile attachment to silently drop the rest of the batch. Maintainers using these versions should upgrade immediately to secure their email processing pipelines.
Who is affected
Applications utilizing mail-parser versions 4.6.0 to 4.6.2 to extract email attachments are vulnerable when processing messages containing attacker-controlled MIME metadata. Specially crafted attachments featuring NUL bytes in filenames, overlong basenames, or undecodable payloads will raise unhandled exceptions during write_attachments(), causing all subsequent attachments in the batch to be silently omitted from the extraction directory while remaining intact for the recipient.
Exploitability
The vulnerability carries a CVSS base score of 6.5 with a vector of CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L, indicating that exploitation requires network access with low complexity and no privileges or user interaction. The EPSS score is 0.003 and CISA KEV status is no, meaning active exploitation is not currently documented in known catalogs.
Remediation
- Upgrade the PyPI mail-parser package to version 4.6.3 or later.
- If unable to upgrade immediately, avoid calling write_attachments() on untrusted mail and instead iterate parser.attachments manually within a try/except block to handle errors per attachment.
How to check your project
- Check project dependency files such as requirements.txt, pyproject.toml, or poetry.lock for mail-parser versions >= 4.6.0 and < 4.6.3.
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.6.0, < 4.6.3 | 4.6.3 | python -m pip install 'mail-parser>=4.6.3' |
CVSS 3.1 vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
| Attack vector | Network |
|---|---|
| Attack complexity | Low |
| Privileges required | None |
| User interaction | None |
| Scope | Unchanged |
| Confidentiality | None |
| Integrity | Low |
| Availability | Low |
FAQ
What causes the attachments to be dropped?
A single crafted attachment using NUL bytes, overlong basenames, or invalid base64 encoding triggers an unhandled exception inside the write_attachments() loop, aborting the process and preventing the remaining attachments from being written.
Is the mail parsing function itself affected?
No, the parse() function is unaffected because it catches the ValueError, meaning the issue is strictly contained to the attachment writing path introduced in version 4.6.0.
How does version 4.6.3 resolve the issue?
Version 4.6.3 wraps individual attachment processing in a way that catches, logs, and skips unusable attachments rather than aborting the entire batch, while also truncating overlong names and safely reordering base64 decoding.
Original advisory description
References
- WEB https://github.com/SpamScope/mail-parser/security/advisories/GHSA-8cgq-x343-p74c
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-129301
- WEB https://github.com/SpamScope/mail-parser/pull/171
- WEB https://github.com/SpamScope/mail-parser/commit/11b894a0b8b3f11055a99caff118206138d1daba
- WEB https://github.com/SpamScope/mail-parser/commit/e1d9fe6778045d6e2c44406bc8822e3464c1097f
- PACKAGE https://github.com/SpamScope/mail-parser
- WEB https://github.com/SpamScope/mail-parser/releases/tag/4.6.3
Source records: GHSA-8cgq-x343-p74c (OSV.dev) · EPSS by FIRST, 2026-11-26.