GHSA-72px-j8gh-p79x

Suggest an improvement
Source
https://github.com/advisories/GHSA-72px-j8gh-p79x
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-72px-j8gh-p79x/GHSA-72px-j8gh-p79x.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-72px-j8gh-p79x
Aliases
  • CVE-2026-129297
Published
2026-11-16T22:11:54Z
Modified
2026-11-16T22:15:05Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N CVSS Calculator
Summary
mail-parser: Sender IP address spoofing in get_server_ipaddress()
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 from clause 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.

Database specific
{
    "cwe_ids": [
        "CWE-20",
        "CWE-345"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-16T22:11:54Z",
    "nvd_published_at": "2026-11-16T18:17:30Z",
    "severity": "HIGH"
}
References

Affected packages

PyPI / mail-parser

Package

Name
mail-parser
View open source insights on deps.dev
Purl
pkg:pypi/mail-parser

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
4.6.2

Affected versions

0.*
0.5.0
1.*
1.0.0rc1
1.0.0
1.1.0
1.1.1
1.1.2
1.1.3
1.1.4
1.1.5
1.1.6
1.1.7
1.1.8
1.1.9
1.1.10
1.2.0
1.2.1
1.2.2
1.2.4
1.2.5
1.2.6
2.*
2.0.0
2.0.1
2.1.0
3.*
3.0.0
3.1.0
3.2.0
3.2.1
3.2.2
3.2.3
3.2.4
3.2.5
3.2.6
3.2.7
3.3.0
3.3.1
3.3.2
3.3.3
3.4.0
3.4.1
3.5.0
3.5.1
3.6.0
3.6.1
3.7.0
3.7.1
3.8.0
3.8.1
3.9.0
3.9.1
3.9.2
3.9.3
3.10.0
3.11.0
3.12.0
3.13.0
3.14.0
3.15.0
4.*
4.0.0
4.1.0
4.1.2
4.1.3
4.1.4
4.2.0
4.2.1
4.3.0
4.4.0
4.5.0
4.6.0
4.6.1

Database specific

last_known_affected_version_range
"<= 4.6.1"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-72px-j8gh-p79x/GHSA-72px-j8gh-p79x.json"