High

mail-parser: Sender IP address spoofing in get_server_ipaddress()

  • Disclosed: 16.11.2026
  • Updated: 17.11.2026 10:00

Vulnerability Details

Candidate addresses are now selected by position, not by appearance. A bracketed address written by the sender is byte-identical to one written by the MTA, meaning pattern matching alone cannot distinguish between them:

  • The first token of the from clause is the HELO name, regardless of its shape, and is never treated as a candidate.
  • An explicit HELO marker inside a comment group is considered sender text and is excluded.
  • A candidate must sit inside a ( / [ group.
  • IPv4 and IPv6 matches are merged positionally, never family-first.
  • The traversal 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 Changes

get_server_ipaddress() now returns None rather than an unreliable value in two cases that previously returned an address:

  1. A from clause consisting of a bare address with no HELO marker (indistinguishable from EHLO <that address>).
  2. A trusted hop naming no address at all.

Callers must handle None.

Workarounds

There are no workarounds available within mail-parser. Callers who cannot upgrade should not treat the return value of get_server_ipaddress() as trustworthy, and should instead derive sender attribution from an authenticated signal, such as the MTA's own logs or SPF/DKIM/DMARC results evaluated outside of this library.

What to do

Fixed in 4.6.2. Upgrade with pip install --upgrade mail-parser. If unable to upgrade, avoid relying on get_server_ipaddress() and obtain sender attribution from external authenticated sources.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) mail-parser < 4.6.2 4.6.2

References

CVSS score 7.5/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Weakness (CWE)
CWE-20, CWE-345
Platform
Python (PyPI)
Package
mail-parser
Disclosed
16.11.2026
Updated
17.11.2026 10:00

Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.

OSV / GitHub Advisory Database - GHSA-72px-j8gh-p79x - CC BY 4.0

Vulnerability history: mail-parser

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
6
First → latest
11.2026 11.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 2
  • Medium 4

Disclosures per year

  1. 2026: 6
  1. Medium · 5.3 CVE-2026-129300 >= 3.7.0, < 4.6.3 4.6.3
  2. mail-parser: Sender IP address spoofing in get_server_ipaddress() this entry
    High · 7.5 CVE-2026-129297 < 4.6.2 4.6.2
  3. High · 7.5 CVE-2026-129295 >= 4.2.0, < 4.6.1 4.6.1
  4. Medium · 6.5 CVE-2026-129296 >= 3.8.0, < 4.6.0 4.6.0

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.