CVE-2026-129296: mail-parser Path Traversal Vulnerability
MODERATECVE-2026-129296 is a MODERATE (CVSS 6.5) path traversal vulnerability (CWE-73: External Control of File Name or Path) affecting mail-parser libraries in the PyPI ecosystem. The issue involves path traversal vulnerability in attachment extraction. Remediation is available by upgrading affected packages to version 4.6.0.
CVE-2026-129296 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N).
How to Fix CVE-2026-129296
To remediate this vulnerability, upgrade all affected mail-parser dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install mail-parser>=4.6.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show mail-parser
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-129296, inspect your installed packages using pip:
pip show mail-parser
Analyze the terminal output to locate any version of mail-parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.6.0), your application is affected.
Note: The pip show mail-parser command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-73: External Control of File Name or Path, where the product allows user input to control or influence paths or file names that are used in filesystem operations. In mail-parser, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-129296 Affected mail-parser Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mail-parser
|
PyPI |
≥ 3.8.0
< 4.6.0
|
4.6.0
|
References
Frequently Asked Questions
What is CVE-2026-129296?
Which mail-parser versions are affected?
What version fixes CVE-2026-129296?
Is mail-parser affected?
What is the CVSS score of CVE-2026-129296?
What CWE is associated with CVE-2026-129296?
How can I check PyPI dependencies for CVE-2026-129296?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fr3h-cpq2-9496",
"modified" : "2026-11-16T22:10:55Z",
"published" : "2026-11-16T22:10:55Z",
"aliases" : [ "CVE-2026-129296" ],
"summary" : "mail-parser: Path Traversal vulnerability in attachment extraction",
"details" : "A path traversal vulnerability was identified in mail-parser when extracting email attachments using the write_attachments() and write_sample() APIs.\n\nA 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.\n\nThe vulnerability affects mail-parser versions 3.8.0 through 4.5.0.\n\nThe issue has been addressed by introducing comprehensive filename sanitization and path validation before any file is written to disk. The fix includes:\n\n- Sanitization of attachment filenames before writing.\n- Validation that all output paths remain within the intended destination directory.\n- Rejection of symbolic link targets.\n- Normalization of Windows and POSIX path separators.\n- Validation and rejection of invalid or unsafe filenames.\n- Protection applied consistently in both write_attachments() and write_sample() APIs.\n\nUsers are strongly encouraged to upgrade to the patched release.\n\n## Credits\n\nThe vulnerability was responsibly reported by **Niranjan Ganesan** (Security Insights, https://securityinsights.io/, GitHub: @iam-niranjan).\n\nThe vulnerability was analyzed, remediated, and the security fix was implemented by **Fedele Mantuano**, maintainer of mail-parser (LinkedIn: https://www.linkedin.com/in/fmantuano/).\n\nmail-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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "mail-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.8.0"
}, {
"fixed" : "4.6.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/SpamScope/mail-parser/security/advisories/GHSA-fr3h-cpq2-9496"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-129296"
}, {
"type" : "WEB",
"url" : "https://github.com/SpamScope/mail-parser/pull/165"
}, {
"type" : "WEB",
"url" : "https://github.com/SpamScope/mail-parser/commit/3d6cb7a51f2ad7ea57e529121dbd5d56f29fefe8"
}, {
"type" : "WEB",
"url" : "https://github.com/SpamScope/mail-parser/commit/b0a2e968815f3ed9e129efb0f5f7e935a9dacd1d"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/SpamScope/mail-parser"
}, {
"type" : "WEB",
"url" : "https://github.com/SpamScope/mail-parser/releases/tag/4.6.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22", "CWE-73" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-11-16T22:10:55Z",
"nvd_published_at" : "2026-11-16T18:17:30Z"
}
}