Multiple security vulnerabilities have been identified in mail-parser, a Python library for parsing email messages. These flaws affect various versions of the software, impacting the integrity, availability, and security of email processing pipelines. The issues range from path traversal and denial of service to data manipulation and unhandled exceptions, posing significant risks to applications that parse untrusted email content.
CVE-2026-129296 (CVSS 6.5 — Medium): This path traversal vulnerability exists in the attachment extraction functionality, specifically within the write_attachments and write_sample APIs. An attacker can craft email attachment filenames using directory traversal sequences or absolute paths to write files outside the intended output directory, potentially leading to arbitrary file overwrite.[/subscribe_to_unlock_form]
Multiple security vulnerabilities have been identified in mail-parser, a Python library for parsing email messages. These flaws affect various versions of the software, impacting the integrity, availability, and security of email processing pipelines. The issues range from path traversal and denial of service to data manipulation and unhandled exceptions, posing significant risks to applications that parse untrusted email content.
CVE-2026-129296 (CVSS 6.5 — Medium): This path traversal vulnerability exists in the attachment extraction functionality, specifically within the write_attachments and write_sample APIs. An attacker can craft email attachment filenames using directory traversal sequences or absolute paths to write files outside the intended output directory, potentially leading to arbitrary file overwrite.[emaillocker id="1283"]
CVE-2026-129295 (CVSS 7.5 — High): A polynomial ReDoS vulnerability affects the regular expressions used for parsing email headers. Attacker-controlled input in address or received headers can cause excessive backtracking, consuming significant CPU resources and denying service to any process parsing untrusted mail.
CVE-2026-129297 (CVSS 7.5 — High): The get_server_ipaddress function is vulnerable to sender IP address spoofing due to flawed logic in identifying trusted hops. An attacker can manipulate header content to cause the function to return an incorrect or spoofed IP address, compromising the integrity of sender attribution.
CVE-2026-129299 (CVSS 6.5 — Medium): This vulnerability involves uncaught exceptions and silent header loss when processing attacker-controlled input. Specific header names or 8-bit byte sequences can trigger exceptions outside the standard error hierarchy or cause header values to be silently dropped or replaced, allowing attackers to evade detection.
CVE-2026-129300 (CVSS 5.3 — Medium): An uncaught OverflowError or OSError occurs when parsing a Received header with an out-of-range date. This causes the entire message parsing to abort, leading to a loss of the message and potential disruption of processing queues.
CVE-2026-129301 (CVSS 6.5 — Medium): A single hostile attachment can abort the write_attachments process, silently dropping all subsequent attachments in the batch. This allows an attacker to hide malicious payloads from downstream scanners by placing a crafted attachment before the real payload.
These vulnerabilities collectively present a significant risk to any system that processes untrusted email data, particularly mail gateways, archiving systems, and security scanners. Users are most at risk if they rely on the library for automated parsing without additional validation or error handling. The general action is to upgrade to a version that addresses these specific flaws to ensure robust and secure email processing.
We recommend you to update mail-parser to version 4.6.1, 4.6.2, or 4.6.3 depending on your installed branch.
The following reports contain further technical details:
[/emaillocker]