CVE-2026-129297: mail-parser Sender IP Address Spoofing Vulnerability
HIGHCVE-2026-129297 is a HIGH (CVSS 7.5) sender ip address spoofing vulnerability (CWE-20: Improper Input Validation) affecting mail-parser libraries in the PyPI ecosystem. The issue involves sender ip address spoofing in get_server_ipaddress(). Remediation is available by upgrading affected packages to version 4.6.2.
CVE-2026-129297 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2026-129297
To remediate this vulnerability, upgrade all affected mail-parser dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install mail-parser>=4.6.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show mail-parser
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-129297, inspect your installed packages using pip:
pip show mail-parser
Analyze the terminal output to locate any version of mail-parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.6.2), your application is affected.
Note: The pip show mail-parser command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In mail-parser, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-129297 Affected mail-parser Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mail-parser
|
PyPI |
< 4.6.2
|
4.6.2
|
References
Frequently Asked Questions
What is CVE-2026-129297?
Which mail-parser versions are affected?
What version fixes CVE-2026-129297?
Is mail-parser affected?
What is the CVSS score of CVE-2026-129297?
What CWE is associated with CVE-2026-129297?
How can I check PyPI dependencies for CVE-2026-129297?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-72px-j8gh-p79x",
"modified" : "2026-11-16T22:11:54Z",
"published" : "2026-11-16T22:11:54Z",
"aliases" : [ "CVE-2026-129297" ],
"summary" : "mail-parser: Sender IP address spoofing in get_server_ipaddress()",
"details" : "### Patches\n\nFixed in **4.6.2**. Upgrade with `pip install --upgrade mail-parser`.\n\nCandidate addresses are now selected by position, not by appearance — a bracketed address\nthe sender wrote is byte-identical to one the MTA wrote, so no amount of pattern matching\ncan tell them apart:\n\n- the first token of the `from` clause is the HELO name, whatever its shape, and is never a\n candidate;\n- an explicit HELO marker inside a comment group is sender text and is excluded;\n- a candidate must sit inside a `(` / `[` group;\n- IPv4 and IPv6 matches are merged positionally, never family-first;\n- the walk stops at the first trusted hop naming no address, rather than continuing into\n sender-written headers.\n\nThe IPv6 pattern was corrected to skip the `IPv6:` tag and to prefer the longest valid form.\n\n**Behaviour change.** `get_server_ipaddress()` now returns `None` rather than an unreliable\nvalue in two cases that previously returned an address: a `from` clause consisting of a bare\naddress with no HELO marker (indistinguishable from `EHLO <that address>`), and a trusted hop\nnaming no address at all. Callers must handle `None`.\n\n### Workarounds\n\nNone within mail-parser. Callers who cannot upgrade should not treat the return value of\n`get_server_ipaddress()` as trustworthy, and should derive sender attribution from an\nauthenticated signal instead — the MTA's own logs, or SPF/DKIM/DMARC results computed\noutside this library.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "mail-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.6.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.6.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/SpamScope/mail-parser/security/advisories/GHSA-72px-j8gh-p79x"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-129297"
}, {
"type" : "WEB",
"url" : "https://github.com/SpamScope/mail-parser/pull/167"
}, {
"type" : "WEB",
"url" : "https://github.com/SpamScope/mail-parser/commit/ce3cf3559db1ff806bda598b378de9f8c2a5be96"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/SpamScope/mail-parser"
}, {
"type" : "WEB",
"url" : "https://github.com/SpamScope/mail-parser/releases/tag/4.6.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-345" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-11-16T22:11:54Z",
"nvd_published_at" : "2026-11-16T18:17:30Z"
}
}