{"id":"CVE-2026-129297","aliases":["CVE-2026-129297","GHSA-72px-j8gh-p79x"],"related":[],"kind":"vulnerability","state":"published","title":"mail-parser: Sender IP address spoofing in `get_server_ipaddress()","summary":"mail-parser is a tool that parses emails by enhancing the Python standard library and extracting message details into a comprehensive object. Prior to 4.6.2, get_server_ipaddress() can select an attacker-controlled address from attacker-controlled Received headers. The minimum mechanism needed to distinguish this spoofing issue, derived from the advisory's remediation analysis and verified fix evidence, is appearance-based candidate selection that can treat bracketed IPv4 or IPv6 addresses or HELO markers in sender-written text as MTA-recorded addresses and can continue past a trusted hop that names no address. Applications that rely on the returned value can attribute a message to an attacker-selected sender IP address. This issue is fixed in version 4.6.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"mail-parser is a tool that parses emails by enhancing the Python standard library and extracting message details into a comprehensive object. Prior to 4.6.2, get_server_ipaddress() can select an attacker-controlled address from attacker-controlled Received headers. The minimum mechanism needed to distinguish this spoofing issue, derived from the advisory's remediation analysis and verified fix evidence, is appearance-based candidate selection that can treat bracketed IPv4 or IPv6 addresses or HELO markers in sender-written text as MTA-recorded addresses and can continue past a trusted hop that names no address. Applications that rely on the returned value can attribute a message to an attacker-selected sender IP address. This issue is fixed in version 4.6.2.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"}],"published":"2026-11-16T17:39:47.311Z","modified":"2026-11-16T22:15:05.618Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-20","CWE-345"],"affected":[{"ranges":[{"version":"< 4.6.2","status":"affected"}],"vendor":"SpamScope","product":"mail-parser","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.6.2"}],"ecosystem":"PyPI","package":"mail-parser","purl":"pkg:pypi/mail-parser","source":"ghsa"}],"references":[{"url":"https://github.com/SpamScope/mail-parser/security/advisories/GHSA-72px-j8gh-p79x","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/SpamScope/mail-parser/pull/167","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/SpamScope/mail-parser/commit/ce3cf3559db1ff806bda598b378de9f8c2a5be96","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/SpamScope/mail-parser/releases/tag/4.6.2","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-129297","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/SpamScope/mail-parser","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-11-16T17:54:23.374Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-129297","url":"https://www.cve.org/CVERecord?id=CVE-2026-129297","licence":"CVE Terms of Use","modified":"2026-11-16T17:54:38.586Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-72px-j8gh-p79x","url":"https://github.com/advisories/GHSA-72px-j8gh-p79x","licence":"CC-BY-4.0","modified":"2026-11-16T22:15:05.618Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-129297","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-129297","licence":"Public domain","modified":"2026-11-16T18:17:30.590Z"}],"updatedAt":"2026-11-25T22:59:50.907Z","epss":{"score":0.00202,"percentile":0.10683,"date":"2026-12-01T12:00:22.000Z"}}