CVE-2026-129297: mail-parser: Sender IP address spoofing in `get_server_ipaddress()
mail-parser is a tool that parses emails by enhancing the Python standard library and extracting message details into a comprehensive object. Prior to 4.6.2, getserveripaddress() can select an attacker-controlled address from attacker-controlled Received headers. The minimum mechanism needed to distinguish this spoofing issue, derived from the advisory's remediation analysis and verified fix evidence, is appearance-based candidate selection that can treat bracketed IPv4 or IPv6 addresses or HELO markers in sender-written text as MTA-recorded addresses and can continue past a trusted hop that names no address. Applications that rely on the returned value can attribute a message to an attacker-selected sender IP address. This issue is fixed in version 4.6.2.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
mail-parserto a version that resolves this vulnerability.Fixed in 4.6.2
Event History
Frequently Asked Questions
Which deployments are exposed to meaningful impact?
Applications using mail-parser versions earlier than 4.6.2 are affected if they rely on get_server_ipaddress() to identify, attribute, filter, or otherwise make decisions based on a message sender IP address.
What does an attacker need to exploit this issue?
An attacker needs to supply a message with attacker-controlled Received header content that includes address-like text, such as bracketed IPv4 or IPv6 addresses or HELO markers. No authentication or user interaction is indicated by the provided severity vector.
What should teams do if they use the returned sender IP for security decisions?
Upgrade mail-parser to version 4.6.2. Until then, do not treat the value returned by get_server_ipaddress() as a trustworthy sender identity when it can influence security, attribution, or filtering decisions.
How can teams determine whether they may be affected?
Check whether mail-parser is below version 4.6.2 and whether the application consumes get_server_ipaddress() output. Exposure is especially relevant where messages from untrusted sources can provide Received headers.