CVE-2026-129295 in mail-parserinfo

Summary

by MITRE • 11/16/2026

mail-parser is a tool that parses emails by enhancing the Python standard library and extracting message details into a comprehensive object. From 4.2.0 until 4.6.1, attacker-controlled email headers can cause polynomial regular-expression backtracking during ordinary parse_from_string(), parse_from_bytes(), or parse_from_file() calls. In src/mailparser/utils.py, get_addresses() invokes the _ADDR_FALLBACK_RE fallback when strict address parsing yields no usable address, and overlapping quantifiers rescan padded address headers quadratically or cubically. In src/mailparser/const.py, parse_received() applies _CLAUSE_SPLITTER to uncollapsed whitespace in a Received header, causing quadratic backtracking when a whitespace run is not followed by a clause keyword. A small, well-formed message can keep mail gateway, ticketing, quarantine, or archival parsing workers busy for extended periods. This issue is fixed in version 4.6.1.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 11/16/2026

The vulnerability identified within the mail-parser library represents a significant risk to systems relying on automated email processing workflows. From versions 4.2.0 through 4.6.1, the software exhibits behavior consistent with Regular Expression Denial of Service, commonly referred to as ReDoS. This class of vulnerabilities arises when an attacker crafts input that causes a regular expression engine to perform excessive backtracking, leading to polynomial time complexity rather than linear or constant time execution. In this specific case, maliciously constructed email headers can trigger these inefficient parsing patterns during standard operations such as parse_from_string(), parse_from_bytes(), or parse_from_file(). The core issue lies in the implementation of regex patterns used for extracting and validating address fields and header clauses, where overlapping quantifiers allow an attacker to force the parser into a state of continuous re-evaluation without making progress toward a match.

The technical root cause is located primarily within two modules: src/mailparser/utils.py and src/mailparser/const.py. In utils.py, the get_addresses() function serves as a critical entry point for processing email addresses. When strict address parsing fails to yield a usable result, the code invokes _ADDR_FALLBACK_RE as a fallback mechanism. This fallback regex contains overlapping quantifiers that are susceptible to catastrophic backtracking. Specifically, if an attacker provides padded or malformed address headers, the regular expression engine may rescan these inputs quadratically or even cubically depending on the structure of the input string. Similarly, in const.py, the parse_received() function processes Received headers using _CLAUSE_SPLITTER. This pattern is designed to split clauses based on whitespace but fails to account for uncollapsed whitespace sequences that are not followed by a recognized clause keyword. When such patterns are encountered, the regex engine engages in quadratic backtracking as it attempts various combinations of matches before ultimately failing or timing out.

The operational impact of this vulnerability extends beyond simple application latency. Because email parsing is often performed synchronously within worker processes for mail gateways, ticketing systems, quarantine solutions, and archival services, a single maliciously crafted message can consume significant CPU resources. A small but carefully constructed message payload is sufficient to trigger the worst-case scenario, keeping these workers busy for extended periods. This effectively results in a denial of service condition where legitimate email processing capabilities are degraded or halted entirely due to resource exhaustion. The impact is particularly severe in high-throughput environments where many such messages might be processed concurrently, potentially leading to system-wide instability or complete unavailability of the mail infrastructure until the offending processes are terminated or restarted.

To mitigate this vulnerability and prevent future occurrences, organizations must immediately upgrade the mail-parser library to version 4.6.1 or later, which contains patches addressing these regex inefficiencies. For systems that cannot be upgraded instantly, implementing input validation at the network perimeter is advisable. This includes restricting header sizes and filtering out headers with excessive whitespace or unusual formatting before they reach the parsing engine. Additionally, deploying rate limiting on email ingestion points can help mitigate the impact of volumetric attacks exploiting this flaw. From a standards perspective, this vulnerability aligns with CWE-400: Uncontrolled Resource Consumption and is categorized under ATT&CK technique T1496: Resource Hijacking, as it allows an attacker to consume computational resources through crafted input rather than direct exploitation for code execution or data theft. Regular security audits of third-party libraries used in email processing pipelines are essential to maintain resilience against such algorithmic complexity attacks.

Responsible

GitHub M

Reservation

11/13/2026

Disclosure

11/16/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!