GHSA-fr3h-cpq2-9496

Suggest an improvement
Source
https://github.com/advisories/GHSA-fr3h-cpq2-9496
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-fr3h-cpq2-9496/GHSA-fr3h-cpq2-9496.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-fr3h-cpq2-9496
Aliases
  • CVE-2026-129296
Published
2026-11-16T22:10:55Z
Modified
2026-11-16T22:15:05Z
Severity
  • 6.5 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N CVSS Calculator
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.

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.
  • Validation and rejection of invalid or unsafe filenames.
  • Protection applied consistently in both write_attachments() and write_sample() APIs.

Users are strongly encouraged to upgrade to the patched release.

Credits

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.

Database specific
{
    "cwe_ids": [
        "CWE-22",
        "CWE-73"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-16T22:10:55Z",
    "nvd_published_at": "2026-11-16T18:17:30Z",
    "severity": "MODERATE"
}
References

Affected packages

PyPI / mail-parser

Package

Name
mail-parser
View open source insights on deps.dev
Purl
pkg:pypi/mail-parser

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.8.0
Fixed
4.6.0

Affected versions

3.*
3.8.0
3.8.1
3.9.0
3.9.1
3.9.2
3.9.3
3.10.0
3.11.0
3.12.0
3.13.0
3.14.0
3.15.0
4.*
4.0.0
4.1.0
4.1.2
4.1.3
4.1.4
4.2.0
4.2.1
4.3.0
4.4.0
4.5.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-fr3h-cpq2-9496/GHSA-fr3h-cpq2-9496.json"