# CVE-2026-129296: mail-parser: Path Traversal vulnerability in attachment extraction

> Crafted email attachments can make mail-parser write files outside the output directory, overwriting files in applications extracting attachments.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Harmful if only installed:** No
- **Needs a specific call:** Yes (`write_attachments()`, `write_sample()`)
- **Fix available:** Yes
- **Published:** 16 Nov 2026
- **Updated:** 16 Nov 2026
- **Also known as:** GHSA-fr3h-cpq2-9496

## What is CVE-2026-129296?

CVE-2026-129296 is a medium-severity path traversal vulnerability in SpamScope mail-parser, published on 16 Nov 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

mail-parser is a tool that parses emails by enhancing the Python standard library and extracting message details into a comprehensive object. From 3.8.0 until 4.6.0, the write_attachments() and write_sample() APIs use attacker-controlled attachment filenames without sufficient sanitization and path containment validation. Directory traversal sequences and absolute filesystem paths can cause an attachment to be written outside the intended output directory. An attacker can overwrite files accessible to the parsing process when an application extracts attachments from a crafted message. This issue is fixed in version 4.6.0.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2026-129296?

1 open source package ship an affected version, including mail-parser.

An affected version is only exploitable if your software calls write_attachments() or write_sample(). Many projects that include it are not exposed.


| Package | Ecosystem | PURL | Affected | Fixed in |
| --- | --- | --- | --- | --- |
| `mail-parser` | PyPI | `pkg:pypi/mail-parser` | From 3.8.0 | 4.6.0 |

Status by vendor (upstream, then each distribution release and vendor build):

| Who | Release | Status | Packages | Fixed in |
| --- | --- | --- | --- | --- |
| Upstream |  | fixed | `mail-parser` | 4.6.0 |

## How do I fix CVE-2026-129296?

Upgrade mail-parser to 4.6.0 or later.

## Is CVE-2026-129296 being exploited?

There is no known exploitation of CVE-2026-129296 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-129296 and fix it if it is affected.

What it is: CVE-2026-129296 is a medium-severity path traversal vulnerability in SpamScope mail-parser, published on 16 Nov 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-129296 in the wild and no public exploit code.
Exposure: An affected version is only exploitable if your software calls write_attachments() or write_sample(). Many projects that include it are not exposed.

Affected packages and fixed versions:
- mail-parser (PyPI): affected from 3.8.0; fixed in 4.6.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
   If an affected version is present, also search the code for calls to write_attachments() or write_sample() and report whether any exist.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-129296/ (Markdown: https://insights.sbomify.com/CVE-2026-129296/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-129296
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-129296
- OSV: https://osv.dev/vulnerability/CVE-2026-129296

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-129296/
Summaries are generated and may contain mistakes; the official description above is the record.
