PyPI
CVE-2026-129296
mail-parser: Path Traversal vulnerability in attachment extraction
- Severity
- Medium 6.5
- Published
- 16 Nov 2026
- Last changed
- 16 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 4.6.0
- Exploit chance
- 0.6% in the next 30 daysHigher than 49% of CVEs. EPSS by FIRST, 24 Nov 2026
- Weakness
- Path traversal (CWE-22)CWE-73
- Attack
- Over the network · No login needed · Needs someone to click or open something
- Attacker can
- Change data
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N- Also known as
- GHSA-fr3h-cpq2-9496
- Sources
- OSV.dev and GitHub
Description
A path traversal vulnerability was identified in mail-parser when extracting email attachments using the write_attachments() and write_sample() APIs.
A specially crafted email containing malicious attachment filenames (for example, using directory traversal sequences such as "../" or absolute filesystem paths) could cause files to be written outside the intended output directory. Depending on how the library was used and the permissions of the executing process, this could result in arbitrary file overwrite.
The vulnerability affects mail-parser versions 3.8.0 through 4.5.0.
The issue has been addressed by introducing comprehensive filename sanitization and path validation before any file is written to disk. The fix includes:
- Sanitization of attachment filenames before writing.
- Validation that all output paths remain within the intended destination directory.
- Rejection of symbolic link targets.
- Normalization of Windows and POSIX path separators.
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-129301mail-parser: One hostile attachment aborts `write_attachments()` and silently drops the rest of the batchMedium 6.5 16 Nov 2026
- 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
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-129296
- GitHub Advisory Database https://github.com/advisories/GHSA-fr3h-cpq2-9496