Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft email with traversal filename
-
DeliveryDeliver message to parsing application
-
ExploitApp extracts via write_attachments()/write_sample()
-
ExecutionFilename joined without containment check
-
PersistFile written outside output directory
-
ImpactOverwrite files accessible to process
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the deploying application (1) runs mail-parser 3.8.0 through 4.5.0 and (2) invokes write_attachments() or write_sample() to save attachments from attacker-supplied email to disk - this is the UI:R / interaction prerequisite. The attacker-controlled input is the attachment filename in Content-Disposition (including RFC 2231 'filename*=' encoded forms such as utf-8''..%2Fmarker.txt) or a Content-ID used as a name; no authentication is needed to send the email (PR:N). Impact is limited by the filesystem permissions of the parsing process (only files writable by that process can be overwritten) and by whether the application actually extracts attachments to disk - applications that only read parsed attachment bytes without calling the write APIs are not exposed. |
| Impact | This is a moderate, context-dependent risk rather than an emergency. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N, base 6.5) reflects an unauthenticated, network-delivered path-traversal that requires the consuming application to actually call the vulnerable extraction APIs (UI:R), with high integrity impact (arbitrary file overwrite) but no confidentiality or availability impact. The vuln.today decision label is 'this_month' - a prioritize-but-not-immediate signal - which is consistent with the absence of a CISA KEV listing and no supplied EPSS score. No exploitation-probability (EPSS) value was provided in the input, so widespread-versus-targeted likelihood cannot be quantified. The references are vendor fix artifacts (GHSA advisory, PR #165, two commits, and the 4.6.0 release) rather than exploit code, so there is no confirmed public weaponized exploit. The key caveat: real risk is almost entirely gated by whether a deployed application passes attacker-controlled attachments to write_attachments()/write_sample() against a writable directory - the library itself is only dangerous when used that way, so raw CVSS overstates risk for deployments that do not save attachments to disk. |
| Exploit ScenarioDerived | An attacker sends a crafted email whose attachment filename contains directory-traversal sequences (e.g. '../') or an absolute path. When a downstream application running mail-parser 3.8.0-4.5.0 extracts attachments via write_attachments() or write_sample(), the file is written outside the intended output directory, overwriting any file the parsing process can write. No public weaponized exploit is identified, though the fix's regression test demonstrates the crafted-filename trigger. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 16, 2026
mail-parser versions 3.8.0 through 4.5.0 write email attachments to disk using the sender-supplied filename from Content-Disposition (including RFC 2231 'filename*=' encoded forms) or Content-ID without stripping directory components or verifying that the resulting path stays inside the output directory, so a crafted message can overwrite files outside it. The flaw is reachable only when the consuming application calls write_attachments() or write_sample() on attacker-supplied email - that extraction step is the user-interaction prerequisite - and the attacker can only overwrite files the parsing process itself can write. No public exploit code identified at time of analysis; the vendor shipped a fix in 4.6.0 that sanitizes filenames, enforces path containment, rejects symlink destinations and deduplicates names, making this a moderate, context-dependent risk rather than an emergency.
RemediationAI
Upgrade mail-parser to version 4.6.0 or later (pip install --upgrade mail-parser), which applies filename sanitization, path containment validation, symlink rejection, separator normalization and per-batch deduplication in both write_attachments() and write_sample(); the fix is visible in pull request https://github.com/SpamScope/mail-parser/pull/165 with commits 3d6cb7a51f2ad7ea57e529121dbd5d56f29fefe8 and b0a2e968815f3ed9e129efb0f5f7e935a9dacd1d. If upgrading is not immediately possible, stop passing the untrusted 'filename' value into filesystem paths: reduce it to a basename yourself, reject names that are empty, '.' or '..' or that contain NUL bytes or either path separator, and confirm with os.path.commonpath that the resolved destination still sits under the intended directory before opening it. Direct the write APIs at a dedicated extraction directory owned by a low-privilege account so that a traversal can only reach files that account can already modify, and avoid following pre-existing symlinks there. Calls that only need attachment content should consume the in-memory bytes instead of invoking the write APIs at all, which removes the vulnerable path entirely. Note that these application-side measures duplicate the 4.6.0 logic and can drift from it; the upgrade remains the complete fix.
Affected VersionsENISA
Affected Packages
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 is a Python library that wraps the standard email package and exposes parsed messages, including an attachments list, as objects. The root cause class is CWE-22 (improper limitation of a pathname to a restricted directory), compounded by CWE-73 (external control of file name or path): the 'filename' value decoded from MIME headers is untrusted metadata that was previously joined directly to the caller's output directory in write_attachments() and in write_sample(binary, payload, path, filename). Absolute paths and '../' sequences therefore resolved outside that directory, and pre-existing symlinks at the destination were not checked. The 4.6.0 fix adds a _safe_attachment_filename() helper that rejects non-string and NUL-containing names, normalizes both POSIX '/' and Windows '\\' separators before taking os.path.basename(), and rejects '', '.' and '..'; write_sample() now creates the directory with exist_ok=True, resolves both the base directory and the candidate path with os.path.realpath(), and requires os.path.commonpath() to equal the base while rejecting os.path.islink() targets. The same change exposes a new 'safe_filename' field on attachment entries and adds batch deduplication with compound-extension awareness (.tar.gz, .tar.xz, .tar.zst, etc.). Because the write paths are library APIs rather than network endpoints, exposure depends entirely on how the integrating application uses them.
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
AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
Email is network-delivered (AV:N) with no auth to send (PR:N), but exploitation depends on the application invoking the write APIs (UI:R); impact is arbitrary file overwrite (I:H) with no disclosure or guaranteed outage (C:N/A:N).
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
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.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
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
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
EUVD-2026-126571
GHSA-fr3h-cpq2-9496
NVD
CVE.org
EPSS
Exploit-DB