MAIL-PARSER · CVE-2026-129296 · Package
FIX → 4.6.0
mail-parser's write_attachments() and write_sample() functions accept attachment filenames containing path traversal sequences such as "../" or absolute paths. A crafted email can make the library write files outside the intended directory, which can overwrite arbitrary files depending on process permissions.
first public Aug 9, 2026 · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Applications that use the mail-parser Python package to save email attachments to disk from messages they do not fully trust, through write_attachments() or write_sample(). Code that only parses email in memory, or never calls those two functions, is not exposed by this flaw.
Not affected if no-attachment-writing, trusted-input-only
Who cares mail-parser, python
pip show mail-parser; affected versions are 3.8.0 through 4.5.0.write_attachments() or write_sample() on untrusted email input.Upgrade to 4.6.0
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:
Users are strongly encouraged to upgrade to the patched release.
The vulnerability was responsibly reported by Niranjan Ganesan (Security Insights, https://securityinsights.io/, GitHub: @iam-niranjan).
The vulnerability was analyzed, remediated, and the security fix was implemented by Fedele Mantuano, maintainer of mail-parser (LinkedIn: https://www.linkedin.com/in/fmantuano/).
mail-parser would like to thank Niranjan Ganesan for following a coordinated vulnerability disclosure process and for collaborating throughout the remediation and verification of the fix.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.
mail-parser4.6.0This page as .md · .json · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
NVD data is provided by NIST and is public domain · GitHub Advisory Database, CC-BY 4.0. Posts quoted belong to their authors.