MEDIUMCVSS v3.1 6.5Vulnerability

CVE-2026-129301

### Impact `write_attachments()` called `_safe_attachment_filename()` and `write_sample()` inside its loop with no guard, so a single crafted attachment raised out of the whole save. Every attachment **after** the malicious one was silently never written, with no error surfaced to a caller that catches only `MailParserError`. That is an evasion primitive as much as an availability bug: a sender puts one poisoned part first and the real payload second, and the payload never reaches the extraction directory that a downstream scanner or sandbox reads — while it still reaches the recipient's mail client intact. The tool's output diverges from the bytes actually in the message, which is the same failure mode as the filename-sanitizing bypass in [GHSA-fr3h-cpq2-9496](https://github.com/SpamScope/mail-parser/security/advisories/GHSA-fr3h-cpq2-9496). Three shapes were reachable, all from attacker-controlled MIME metadata: - **NUL smuggled through RFC 2231** — `filename*=us-ascii''evil%00.bin` decodes to a NUL in the filename during parsing and raised `ValueError` out of the name check; - **overlong basename** — a filename longer than `NAME_MAX` (e.g. 300 characters) raised `OSError: File name too long` from `open()`, *after* creating a zero-byte stub on disk; - **undecodable payload** — a body that is not valid base64 raised `binascii.Error` (a `ValueError` subclass) from the decode performed inside the `open()` block. ```python import tempfile, mailparser raw = ("Content-Type: multipart/mixed; boundary=b\r\n\r\n" "--b\r\nContent-Type: application/octet-stream\r\n" "Content-Disposition: attachment; filename*=us-ascii''evil%00.bin\r\n\r\nxx\r\n" "--b\r\nContent-Type: application/octet-stream\r\n" "Content-Disposition: attachment; filename=good.bin\r\n\r\nyy\r\n" "--b--\r\n") mp = mailparser.parse_from_string(raw) # parse itself is fine; safe_filename is None mp.write_attachments(tempfile.mkdtemp()) # 4.6.0 - 4.6.2 -> ValueE

Properties

Summary
mail-parser: One hostile attachment aborts `write_attachments()` and silently drops the rest of the batch
Severity
medium
Nvd fetched at
2026-11-16T22:44:16.771339+00:00
Cvss score
6.5
Cvss severity
MEDIUM
Retrieved at
2026-11-16T22:45:19+00:00
Ghsa published
2026-11-16T22:22:13Z
Source url
https://github.com/advisories/GHSA-8cgq-x343-p74c
Ghsa updated
2026-11-16T22:23:34Z
Ghsa id
GHSA-8cgq-x343-p74c
Last source
GitHub Advisory Database
Score
6.5
Cvss version
3.1
Cve id
CVE-2026-129301
Cvss vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
First seen by Signal
2026-11-16T18:35:21+00:00
Is ghsa only
false
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
Published at
2026-11-16T18:17:31.190
Last modified
2026-11-16T18:17:31.190

Related Entities (4)

HAS_WEAKNESS (2)

AFFECTS (1)

→[Software]pip/mail-parser

VULNERABLE_TO (1)

←[Software]pip/mail-parser

Related research

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-129301 (CVSS v3.1 6.5) — Ninja Signal Threat Intelligence | Ninja Signal