MAIL-PARSER · CVE-2026-129297 · Package
FIX → 4.6.2
mail-parser's get_server_ipaddress() could return an IP address written by the email sender instead of the mail server that actually received the message. An attacker can therefore make a message appear to come from an address of their choosing.
first public Aug 12, 2026 · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Any Python application that uses mail-parser to read the sender IP address from inbound email and makes a decision based on it (spam filtering, allow lists, abuse logging, attribution). Applications that only parse message bodies or headers without using get_server_ipaddress() are not exposed. Callers who cannot upgrade should not trust that return value and should rely on authenticated signals such as MTA logs or SPF/DKIM/DMARC results.
Not affected if no-ip-based-decisions, uses-only-headers-or-body, version-4.6.2-or-later
Who cares email-processing, mail-parser, python
pip show mail-parser and check whether the version is 4.6.1 or lower.get_server_ipaddress() that use its return value for allow lists, rate limits, spam scoring or audit logs.Upgrade to 4.6.2
mail-parser upgrade to (fixed version per the product data).Fixed in 4.6.2. Upgrade with pip install --upgrade mail-parser.
Candidate addresses are now selected by position, not by appearance — a bracketed address the sender wrote is byte-identical to one the MTA wrote, so no amount of pattern matching can tell them apart:
from clause is the HELO name, whatever its shape, and is never a
candidate;( / [ group;The IPv6 pattern was corrected to skip the IPv6: tag and to prefer the longest valid form.
Behaviour change. get_server_ipaddress() now returns None rather than an unreliable
value in two cases that previously returned an address: a from clause consisting of a bare
address with no HELO marker (indistinguishable from ), and a trusted hop
naming no address at all. Callers must handle .
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.
4.6.2get_server_ipaddress() can return None; callers must handle None.EHLO <that address>NoneNone within mail-parser. Callers who cannot upgrade should not treat the return value of
get_server_ipaddress() as trustworthy, and should derive sender attribution from an
authenticated signal instead — the MTA's own logs, or SPF/DKIM/DMARC results computed
outside this library.
This page as .md · .json · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NVD data is provided by NIST and is public domain · GitHub Advisory Database, CC-BY 4.0. Posts quoted belong to their authors.