CVE-2026-129296: mail-parser: Path Traversal vulnerability in attachment extraction
Published 2026-11-16 · Updated 2026-11-16 · Also known as GHSA-fr3h-cpq2-9496
Summary
A path traversal vulnerability in the mail-parser library allows malicious attachment filenames to write files outside the intended directory via write_attachments() and write_sample(). Engineering teams using versions 3.8.0 through 4.5.0 should upgrade immediately.
Who is affected
Affected deployments are those utilizing mail-parser versions 3.8.0 to 4.5.0 to process untrusted emails and extract attachments. When processing a specially crafted email containing directory traversal sequences or absolute paths, arbitrary file overwrites can occur depending on process permissions.
Exploitability
The vulnerability can be exploited over the network with low attack complexity, requiring user interaction to open a malicious email containing the crafted attachment filename. It has a CVSS base score of 6.5 with high integrity impact, and an EPSS score of 0.006 while not being listed on the CISA KEV catalog.
Remediation
- Upgrade the PyPI mail-parser package to version 4.6.0 or later.
- Ensure input files processed by write_attachments() and write_sample() come from trusted sources until the package is updated.
How to check your project
- Check project dependency files such as requirements.txt, setup.py, or pyproject.toml for references to the mail-parser package.
- Inspect dependency lock files or run package manager inspection tools to verify if an affected version between 3.8.0 and 4.5.0 is installed.
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 |
>= 3.8.0, < 4.6.0 | 4.6.0 | python -m pip install 'mail-parser>=4.6.0' |
CVSS 3.1 vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
| Attack vector | Network |
|---|---|
| Attack complexity | Low |
| Privileges required | None |
| User interaction | Required |
| Scope | Unchanged |
| Confidentiality | None |
| Integrity | High |
| Availability | None |
FAQ
Which package and versions are affected?
The PyPI package mail-parser is affected in versions introduced at 3.8.0 and fixed in 4.6.0 (specifically versions 3.8.0 through 4.5.0).
Which APIs are vulnerable?
The write_attachments() and write_sample() APIs are vulnerable to path traversal during attachment extraction.
How was the issue resolved?
The maintainer fixed the issue by introducing filename sanitization, output path validation, symbolic link rejection, and path separator normalization.
Original advisory description
References
- WEB https://github.com/SpamScope/mail-parser/security/advisories/GHSA-fr3h-cpq2-9496
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-129296
- WEB https://github.com/SpamScope/mail-parser/pull/165
- WEB https://github.com/SpamScope/mail-parser/commit/3d6cb7a51f2ad7ea57e529121dbd5d56f29fefe8
- WEB https://github.com/SpamScope/mail-parser/commit/b0a2e968815f3ed9e129efb0f5f7e935a9dacd1d
- PACKAGE https://github.com/SpamScope/mail-parser
- WEB https://github.com/SpamScope/mail-parser/releases/tag/4.6.0
Source records: GHSA-fr3h-cpq2-9496 (OSV.dev) · EPSS by FIRST, 2026-11-26.