Skip to main content

mail-parser CVE-2026-129301

| EUVDEUVD-2026-126575 MEDIUM
Uncaught Exception (CWE-248)
2026-11-16 GitHub_M GHSA-8cgq-x343-p74c
6.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Craft email with poisoned MIME part first
  2. Delivery
    Place real payload as later attachment
  3. Exploit
    Deliver to mail-parser extraction pipeline
  4. Install
    write_attachments() raises on poisoned part
  5. C2
    Save loop aborts, later payload unwritten
  6. Execute
    Downstream scanner reads incomplete directory
  7. Impact
    Malicious payload evades detection

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A10:2025 - Mishandling of Exceptional Conditions
ASVS 5.0
V16 - Security Logging and Error Handling Exception handling completeness
Exploitation Conditions

Exploitation requires a downstream consumer running mail-parser 4.6.0-4.6.2 that calls write_attachments() on attacker-controlled email, and a caller exception handler that catches only MailParserError (so the raised ValueError/OSError/binascii.Error either aborts silently or the dropped attachments go unnoticed). The attacker must control MIME metadata and part ordering, placing one of three trigger shapes first: an RFC 2231 filename decoding to a NUL (filename*=us-ascii''evil%00.bin), a basename exceeding NAME_MAX (e.g. ~300 chars), or an undecodable base64 payload. Limiting factors: the evasion only matters when a scanner/sandbox reads only the extraction directory rather than the delivered message; callers that iterate parser.attachments manually with per-item try/except, or that skip safe_filename==None parts, are not affected; parse() itself was never affected because it already catches the ValueError; and the issue is fully resolved by upgrading to 4.6.3. No operator authentication is required - the trigger is an inbound email (PR:N).

Impact

Signals point to a moderate, patch-this-month issue rather than an emergency. The CVSS 3.1 base is 6.5 (MEDIUM) with vector AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L - network-reachable via a delivered email, no privileges and no user interaction, but impact limited to partial integrity (incomplete/divergent extraction output) and partial availability (aborted save batch); confidentiality impact is explicitly N. The vuln.today decision label is 'this_month', not act_now or emergency. CVE is NOT on CISA KEV, so there is no confirmed active exploitation, and no EPSS score was supplied, so widespread-exploitation probability cannot be quantified from the input - state both as missing. A reproducer PoC is published inside the GHSA advisory, so exploit knowledge is public, but it is a demonstrator, not verified weaponized exploit code. The practical catch: real-world impact depends entirely on an insecure caller pattern - the downstream code must call write_attachments() on untrusted mail AND catch only MailParserError, so the aborted batch is swallowed silently. Where that pattern exists in an email-scanning or sandbox pipeline, this is a genuine detection-evasion primitive (poisoned part first, real payload second, scanner reads an incomplete extraction directory); where attachments are iterated manually it is largely inert. Net: a legitimate but bounded priority, mischaracterized by the 'Information Disclosure' tag since there is no disclosure (C:N) - the true impact is evasion/integrity plus availability.

Exploit ScenarioDerived

An attacker sends an email whose first MIME part carries a hostile filename (RFC 2231 NUL via filename*=us-ascii''evil%00.bin, an over-NAME_MAX basename, or an undecodable base64 body) and places the real malware as a later attachment. When a security pipeline calls write_attachments() (versions 4.6.0-4.6.2) and catches only MailParserError, the first part raises ValueError/OSError/binascii.Error, aborts the save loop, and the malware is never written to the extraction directory a sandbox or scanner inspects - while it still reaches the recipient's mail client intact. A working reproducer is published in the GHSA-8cgq-x343-p74c advisory.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 16, 2026

Attachment extraction in SpamScope mail-parser 4.6.0 through 4.6.2 aborts the entire save batch when a single attacker-crafted MIME part fails, so every attachment ordered after the poisoned part is silently never written to disk and the parser's output diverges from the bytes the recipient actually received. Pipelines that call write_attachments() on untrusted mail and then scan only the extraction directory (malware scanner, sandbox, gateway) can miss a payload hidden behind an RFC 2231 filename decoding to a NUL, a basename exceeding NAME_MAX, or an undecodable base64 body, and callers that catch only MailParserError never observe the underlying ValueError, OSError or binascii.Error. Scored CVSS 6.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L; no confidentiality impact, limited integrity and availability impact), it is not in CISA KEV and no in-the-wild exploitation is confirmed; the upstream advisory publishes a minimal reproducer, and the vendor-released fix is version 4.6.3.

RemediationAI

Vendor-released patch: 4.6.3 - upgrade the mail-parser package to 4.6.3 or later, which is the version the advisory and release notes identify as fixed (https://github.com/SpamScope/mail-parser/releases/tag/4.6.3, fix PR https://github.com/SpamScope/mail-parser/pull/171, commits 11b894a0b8b3f11055a99caff118206138d1daba and e1d9fe6778045d6e2c44406bc8822e3464c1097f). In the patched code a single unusable attachment is logged and skipped, overlong basenames are truncated to 240 UTF-8 bytes with the extension preserved, the base64 decode happens before file creation so no zero-byte stub is left behind, and path-containment failures still raise MailParserPathError rather than being swallowed, so upgrading does not mask escapes from the output directory. If upgrading is not immediately possible, the vendor's stated workaround is to avoid calling write_attachments() on untrusted mail: iterate parser.attachments yourself and write each attachment inside its own try/except Exception, skipping any part whose safe_filename is None - the trade-off is that a hand-rolled loop loses the library's collision handling, filesystem-name clamping and path-containment validation, so those checks must be reimplemented; limiting exposure by parsing untrusted messages without extracting them also avoids the write path entirely, at the cost of not producing files for downstream scanning.

Affected VersionsENISA

mail-parser 4.6.0, < 4.6.3

Affected Packages

pypi mail-parser fix: 4.6.3

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

mail-parser wraps Python's standard email package to turn raw messages into structured objects, and the flaw sits in the write path rather than the parse path: write_attachments() invoked _safe_attachment_filename() and write_sample() inside its loop with no per-item guard, so a single exception escaped and terminated the batch. The root-cause class is CWE-248 (uncaught exception), and it becomes reachable because the filename-reject paths added with the sanitizing work in 4.6.0 (PR #165) raise exceptions rather than returning unusable results for three attacker-controlled MIME shapes: an RFC 2231 extended filename such as filename*=us-ascii''evil%00.bin that decodes to an embedded NUL and raises ValueError during the name check; a basename longer than NAME_MAX (roughly 300 characters) that raises OSError 'File name too long' from open(), notably after a zero-byte stub has already been created on disk; and a body that is not valid base64 that raises binascii.Error (a ValueError subclass) from the decode performed inside the open() block. Because parse() already catches the ValueError internally, only the extraction path was unguarded, and the exceptions thrown are outside the MailParserError hierarchy, so a caller's expected library-exception handler does not see them. The 4.6.3 fix logs and skips the individual unusable attachment, truncates overlong basenames to 240 UTF-8 bytes while preserving the extension, moves the base64 decode before open() so failures leave no stub, repairs padding and alphabet errors the way mail clients do, and folds filename comparison case-insensitively during deduplication; containment failures now raise MailParserPathError, which is deliberately not swallowed by the per-attachment handler so path traversal still stops the batch. The advisory links this to the same output-divergence failure mode as GHSA-fr3h-cpq2-9496, the earlier filename-sanitizing bypass.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 6.5 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
vuln.today AI 6.5 MEDIUM

Triggered by a delivered email with no auth or interaction (AV:N/AC:L/PR:N/UI:N); impact is incomplete/divergent extraction (I:L) and an aborted batch (A:L), with no data disclosure (C:N).

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N
Red Hat 6.5 MEDIUM

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
Low

Lifecycle Timeline

1
Patch available
Nov 16, 2026 - 19:02 EUVD

DescriptionCVE.org

mail-parser is a tool that parses emails by enhancing the Python standard library and extracting message details into a comprehensive object. From 4.6.0 until 4.6.3, write_attachments() calls _safe_attachment_filename() and write_sample() without isolating failures for individual attacker-controlled MIME parts. An RFC 2231 filename containing a NUL, a basename exceeding NAME_MAX, or an undecodable base64 payload can raise ValueError, OSError, or binascii.Error and abort the entire save loop. Later attachments remain unwritten; when a caller catches only MailParserError, the failure is not surfaced through the expected library-exception path. If a downstream scanner or sandbox reads only the extraction directory, a payload after the crafted part can be missed even though it remains in the delivered message, and the aborted batch also causes availability loss. This issue is fixed in version 4.6.3.

Threat Intelligence Overview

EPSS Score
0.3%
Top 73% exploitable
Prevalence
Low
niche Python email-parsing library, mainly in security/mail pipelines
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Social Media
2
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact· derived
Medium

Priority Score

52
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +32
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy