{"id":"CVE-2026-129297","kind":"vulnerability","aliases":["CVE-2026-129297","GHSA-72px-j8gh-p79x"],"related":[],"title":"mail-parser: Sender IP address spoofing in get_server_ipaddress()","description":"### 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.","summary":"mail-parser's get_server_ipaddress() could return an IP address written by the email sender instead of the mail server that actually received the message. An attacker can therefore make a message appear to come from an address of their choosing.","severity":"high","cvss":7.5,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"mail-parser","fixed":["4.6.2"],"affected":"<= 4.6.1","ecosystem":"pypi"}],"ecosystems":["pypi"],"tags":["cwe-20","cwe-345","email-processing","mail-parser","package","python"],"not_affected_if":["no-ip-based-decisions","uses-only-headers-or-body","version-4.6.2-or-later"],"how_to_check":"- Run `pip show mail-parser` and check whether the version is `4.6.1` or lower.\n- Search your code for calls to `get_server_ipaddress()` that use its return value for allow lists, rate limits, spam scoring or audit logs.","fix":"- `mail-parser` upgrade to `4.6.2` (fixed version per the product data).\n- Note: after upgrading, `get_server_ipaddress()` can return `None`; callers must handle `None`.","status":"open","published_at":"2026-11-16T18:17:30+00:00","first_seen_at":"2026-11-16T18:38:03+00:00","triaged_at":"2026-11-16T22:13:27+00:00","updated_at":"2026-11-16T22:13:27+00:00","category":"package","confidence":0.85,"triage":{"at":"2026-11-16T22:13:27Z","model":"claude-haiku-5-5","output":{"fix":"- `mail-parser` upgrade to `4.6.2` (fixed version per the product data).\n- Note: after upgrading, `get_server_ipaddress()` can return `None`; callers must handle `None`.","reach":"internet","title":"mail-parser: forged sender IP address returned from email headers","impact":"medium","summary":"mail-parser's get_server_ipaddress() could return an IP address written by the email sender instead of the mail server that actually received the message. An attacker can therefore make a message appear to come from an address of their choosing.","audience":"developers","category":"package","nicknames":[],"who_cares":["python","mail-parser","email-processing"],"confidence":0.85,"fix_status":"available","needs_auth":"no","worst_case":"Attacker spoofs the sender IP address that the application trusts","analyst_note":"","how_to_check":"- Run `pip show mail-parser` and check whether the version is `4.6.1` or lower.\n- Search your code for calls to `get_server_ipaddress()` that use its return value for allow lists, rate limits, spam scoring or audit logs.","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["no-ip-based-decisions","uses-only-headers-or-body","version-4.6.2-or-later"],"who_is_affected":"Any Python application that uses mail-parser to read the sender IP address from inbound email and makes a decision based on it (spam filtering, allow lists, abuse logging, attribution). Applications that only parse message bodies or headers without using get_server_ipaddress() are not exposed. Callers who cannot upgrade should not trust that return value and should rely on authenticated signals such as MTA logs or SPF/DKIM/DMARC results.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"no","severity_if_unknown":"high"},"cost_usd":0.000832,"input_tokens":5139,"output_tokens":637,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-129297':14A,22A '-20':27B '-2026':13A,21A '-345':29B '4.6.2':84C '72px':17A 'actual':61B 'address':6A,49B,77B,94C,105C,189C,235C,243C,257C 'amount':120C 'apart':127C 'appear':72B,102C 'attack':66B 'attribut':290C 'authent':293C 'bare':242C 'behaviour':215C 'bracket':104C 'byte':111C 'byte-ident':110C 'caller':260C,270C 'candid':93C,146C,162C 'cannot':272C 'case':230C 'chang':216C 'choos':80B 'claus':134C,238C 'come':74B 'comment':153C 'comput':304C 'consist':239C 'continu':192C 'correct':202C 'could':45B 'cve':12A,20A 'cwe':26B,28B 'deriv':288C 'ehlo':250C 'email':31B,53B 'email-process':30B 'exclud':160C 'explicit':148C 'famili':177C 'family-first':176C 'first':129C,178C,184C 'fix':82C 'form':214C 'get':9A,42B,217C,281C 'ghsa':16A 'ghsa-72px-j8gh-p79x':15A 'group':154C,167C 'handl':262C 'header':197C 'helo':137C,149C,246C 'hop':186C,254C 'ident':112C 'indistinguish':248C 'insid':151C,165C 'instal':88C 'instead':55B,295C 'ip':5A,48B 'ipaddress':11A,44B,219C,283C 'ipv4':168C 'ipv6':170C,199C,206C 'j8gh':18A 'librari':307C 'log':300C 'longest':212C 'mail':2A,24A,34B,39B,58B,91C,268C 'mail-pars':1A,33B,38B,90C,267C 'mail-parser':23A 'make':69B 'marker':150C,247C 'match':123C,171C 'merg':173C 'messag':64B,71B 'mta':116C,297C 'must':163C,261C 'name':138C,187C,255C 'never':144C,175C 'none':222C,263C,265C 'one':114C 'outsid':305C 'p79x':19A 'packag':36B 'parser':3A,25A,35B,40B,92C,269C 'patch':81C 'pattern':122C,200C 'pip':87C 'posit':99C,174C 'prefer':210C 'previous':232C 'process':32B 'python':37B 'rather':190C,223C 'receiv':62B 'result':303C 'return':46B,221C,233C,278C 'select':97C 'sender':4A,54B,107C,156C,195C,289C 'sender-written':194C 'server':10A,43B,59B,218C,282C 'shape':141C 'signal':294C 'sit':164C 'skip':204C 'spf/dkim/dmarc':302C 'spoof':7A 'stop':181C 'tag':207C 'tell':125C 'text':157C 'therefor':68B 'token':130C 'treat':276C 'trust':185C,253C 'trustworthi':285C 'two':229C 'unreli':226C 'upgrad':85C,89C,273C 'valid':213C 'valu':227C,279C 'walk':180C 'whatev':139C 'within':266C 'workaround':264C 'written':50B,196C 'wrote':108C,117C","nicknames":[],"mitigations":[],"who_affected":"Any Python application that uses mail-parser to read the sender IP address from inbound email and makes a decision based on it (spam filtering, allow lists, abuse logging, attribution). Applications that only parse message bodies or headers without using get_server_ipaddress() are not exposed. Callers who cannot upgrade should not trust that return value and should rely on authenticated signals such as MTA logs or SPF/DKIM/DMARC results.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["mailparser"],"ptokens":["mail","parser"],"labels":["cwe20","cwe345","emailprocessing","high","mailparser","package","pypi","python"],"campaign_type":null,"search_a":"'-129297':14A,22A '-2026':13A,21A '72px':17A 'address':6A 'cve':12A,20A 'get':9A 'ghsa':16A 'ghsa-72px-j8gh-p79x':15A 'ip':5A 'ipaddress':11A 'j8gh':18A 'mail':2A,24A 'mail-pars':1A 'mail-parser':23A 'p79x':19A 'parser':3A,25A 'sender':4A 'server':10A 'spoof':7A","search_b":"'-20':27B '-345':29B 'actual':61B 'address':49B,77B 'appear':72B 'attack':66B 'choos':80B 'come':74B 'could':45B 'cwe':26B,28B 'email':31B,53B 'email-process':30B 'get':42B 'instead':55B 'ip':48B 'ipaddress':44B 'mail':34B,39B,58B 'mail-pars':33B,38B 'make':69B 'messag':64B,71B 'packag':36B 'parser':35B,40B 'process':32B 'python':37B 'receiv':62B 'return':46B 'sender':54B 'server':43B,59B 'therefor':68B 'written':50B","search_c":"'4.6.2':84C 'address':94C,105C,189C,235C,243C,257C 'amount':120C 'apart':127C 'appear':102C 'attribut':290C 'authent':293C 'bare':242C 'behaviour':215C 'bracket':104C 'byte':111C 'byte-ident':110C 'caller':260C,270C 'candid':93C,146C,162C 'cannot':272C 'case':230C 'chang':216C 'claus':134C,238C 'comment':153C 'comput':304C 'consist':239C 'continu':192C 'correct':202C 'deriv':288C 'ehlo':250C 'exclud':160C 'explicit':148C 'famili':177C 'family-first':176C 'first':129C,178C,184C 'fix':82C 'form':214C 'get':217C,281C 'group':154C,167C 'handl':262C 'header':197C 'helo':137C,149C,246C 'hop':186C,254C 'ident':112C 'indistinguish':248C 'insid':151C,165C 'instal':88C 'instead':295C 'ipaddress':219C,283C 'ipv4':168C 'ipv6':170C,199C,206C 'librari':307C 'log':300C 'longest':212C 'mail':91C,268C 'mail-pars':90C,267C 'marker':150C,247C 'match':123C,171C 'merg':173C 'mta':116C,297C 'must':163C,261C 'name':138C,187C,255C 'never':144C,175C 'none':222C,263C,265C 'one':114C 'outsid':305C 'parser':92C,269C 'patch':81C 'pattern':122C,200C 'pip':87C 'posit':99C,174C 'prefer':210C 'previous':232C 'rather':190C,223C 'result':303C 'return':221C,233C,278C 'select':97C 'sender':107C,156C,195C,289C 'sender-written':194C 'server':218C,282C 'shape':141C 'signal':294C 'sit':164C 'skip':204C 'spf/dkim/dmarc':302C 'stop':181C 'tag':207C 'tell':125C 'text':157C 'token':130C 'treat':276C 'trust':185C,253C 'trustworthi':285C 'two':229C 'unreli':226C 'upgrad':85C,89C,273C 'valid':213C 'valu':227C,279C 'walk':180C 'whatev':139C 'within':266C 'workaround':264C 'written':196C 'wrote':108C,117C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-08-12T20:56:17+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-129297","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-129297","severity":null,"published_at":"2026-11-16T18:17:30+00:00","modified_at":"2026-11-16T18:17:30+00:00","first_seen_at":"2026-11-16T18:38:03+00:00","fetched_at":"2026-11-16T18:38:03+00:00","note":null},{"source":"ghsa","external_id":"GHSA-72px-j8gh-p79x","url":"https://github.com/advisories/GHSA-72px-j8gh-p79x","severity":"high","published_at":"2026-11-16T22:11:54+00:00","modified_at":"2026-11-16T22:11:55+00:00","first_seen_at":"2026-11-16T22:12:15+00:00","fetched_at":"2026-11-16T22:17:23+00:00","note":null}],"documents":[{"id":171755,"url":"https://github.com/SpamScope/mail-parser/commit/ce3cf3559db1ff806bda598b378de9f8c2a5be96","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":171756,"url":"https://github.com/SpamScope/mail-parser/releases/tag/4.6.2","title":"Release notes: github.com","kind":"release","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release notes: github.com"},{"id":171757,"url":"https://github.com/SpamScope/mail-parser/security/advisories/GHSA-72px-j8gh-p79x","title":"Vendor advisory: github.com","kind":"vendor","source":"nvd","publisher":"vendor","text":null,"published_at":"2026-08-12T20:56:17+00:00","relation":"advisory","confidence":null,"note":"Vendor advisory: github.com"},{"id":172676,"url":"https://api.github.com/repos/SpamScope/mail-parser/security-advisories/GHSA-72px-j8gh-p79x","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"},{"id":172678,"url":"https://github.com/SpamScope/mail-parser/pull/167","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"}],"disclosures":[],"exploit_sources":[],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}