CVE-2026-129297: mail-parser Sender IP Address Spoofing Vulnerability

HIGH
Advisory Identifier: GHSA-72px-j8gh-p79x
CVSS 7.5
CWE-20 CWE-345
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-129297
GHSA Identifier GHSA-72px-j8gh-p79x
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-20: Improper Input Validation
Affected Product mail-parser
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (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.

mail-parser fixed: 4.6.2
pip install mail-parser>=4.6.2
Verify Direct and Transitive Dependencies

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

### 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.

CVE-2026-129297 Affected mail-parser Versions

1 component(s)
Fixed Versions:
4.6.2
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?
CVE-2026-129297 is a security vulnerability in mail-parser involving Sender IP address spoofing in get_server_ipaddress() under CWE-20: Improper Input Validation.
Which mail-parser versions are affected?
Affected versions include releases prior to 4.6.2 across affected packages: mail-parser.
What version fixes CVE-2026-129297?
Upgrading to 4.6.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mail-parser affected?
Yes, mail-parser is affected in releases prior to 4.6.2. Upgrade your dependency to 4.6.2 or later.
What is the CVSS score of CVE-2026-129297?
CVE-2026-129297 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-129297?
CVE-2026-129297 is classified under CWE-20: Improper Input Validation (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.).
How can I check PyPI dependencies for CVE-2026-129297?
Run the dependency tree command: 'pip show mail-parser'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}