Summary
mail-parser: Sender IP address spoofing in get_server_ipaddress()
Advisory details
Patches
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:
- the first token of the
fromclause is the HELO name, whatever its shape, and is never a candidate; - an explicit HELO marker inside a comment group is sender text and is excluded;
- a candidate must sit inside a
(/[group; - IPv4 and IPv6 matches are merged positionally, never family-first;
- the walk stops at the first trusted hop naming no address, rather than continuing into sender-written headers.
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 EHLO <that address>), and a trusted hop
naming no address at all. Callers must handle None.
Workarounds
None 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.
References
- https://github.com/advisories/GHSA-72px-j8gh-p79x
- https://github.com/SpamScope/mail-parser/security/advisories/GHSA-72px-j8gh-p79x
- https://nvd.nist.gov/vuln/detail/CVE-2026-129297
- https://github.com/SpamScope/mail-parser/pull/167
- https://github.com/SpamScope/mail-parser/commit/ce3cf3559db1ff806bda598b378de9f8c2a5be96
- https://github.com/SpamScope/mail-parser/releases/tag/4.6.2
Related vulnerabilities
All Supply chain →- MEDIUMCVE-2026-59831
GitHub CLI gh codespace jupyter may allow code execution via unvalidated URLs from malicious Codespaces
- HIGHCVE-2026-58262
Klever Go counts bitmap padding bits toward BLS quorum, allowing blocks with insufficient signatures
- HIGHCVE-2026-104199
aMQTT: Inefficient Regular Expression Complexity and Uncontrolled Resource Consumption and Improper Input Validation
- CRITICALCVE-2026-77367
Daptin: Unauthenticated SQL Injection via the `sort` query parameter on every entity list endpoint
- MEDIUMCVE-2026-62337
snark-verifier: Halo 2 aggregation circuit mishandles point-at-infinity proof elements
- MEDIUMCVE-2026-129304
Guard Core: Unvalidated X-Forwarded-For-derived string used as a Redis key component and interpolated into a KEYS glob pattern