CVE-2026-129297: mail-parser: Sender IP address spoofing in get_server_ipaddress()
Published 2026-11-16 · Updated 2026-11-16 · Also known as GHSA-72px-j8gh-p79x
Summary
The mail-parser library contains a vulnerability in get_server_ipaddress() that allows attackers to spoof sender IP addresses by crafting malicious email headers. Developers relying on this function for security-critical decisions must upgrade to version 4.6.2 or implement alternative authentication mechanisms.
Who is affected
Affected deployments are those using mail-parser to extract and rely on sender IP information from email headers. The vulnerability allows an attacker to inject misleading IP data, potentially bypassing security filters or audit logs that trust the output of get_server_ipaddress(). Because the library previously accepted ambiguous header tokens, it could be tricked into returning attacker-controlled addresses instead of legitimate MTA-reported ones.
Exploitability
The vulnerability is rated as High severity with a base score of 7.5, reflecting that it can be exploited remotely over the network with low complexity and no user interaction. While the current EPSS score is low at 0.002, the flaw poses a significant risk for systems that treat the returned IP address as an authenticated signal. There is currently no record of active exploitation in CISA's Known Exploited Vulnerabilities catalog.
Remediation
- Upgrade the mail-parser package to version 4.6.2 or later using 'pip install --upgrade mail-parser'.
- Update application code to handle a 'None' return value from get_server_ipaddress(), as the library no longer returns unreliable values for ambiguous headers.
How to check your project
- Check the 'requirements.txt', 'pyproject.toml', or 'setup.py' files for the version of 'mail-parser' installed in the project environment.
- Use 'pip show mail-parser' to verify the currently installed version of the library in the production or development environment.
Automated analysis of the published advisory data, generated 2026-11-18. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| PyPI | mail-parser |
>= 0, < 4.6.2 | 4.6.2 | python -m pip install 'mail-parser>=4.6.2' |
CVSS 3.1 vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
| Attack vector | Network |
|---|---|
| Attack complexity | Low |
| Privileges required | None |
| User interaction | None |
| Scope | Unchanged |
| Confidentiality | None |
| Integrity | High |
| Availability | None |
FAQ
Does this update introduce breaking changes?
Yes, get_server_ipaddress() will now return 'None' in scenarios where it previously returned unreliable data. Callers must update their logic to handle this return value correctly.
Is there a workaround if I cannot upgrade immediately?
No internal workaround exists. Callers should stop treating the return value of get_server_ipaddress() as trustworthy and instead derive sender attribution from authenticated signals like SPF, DKIM, or DMARC results obtained from the MTA.
What specifically causes the spoofing vulnerability?
The library failed to properly distinguish between sender-written addresses in headers and genuine MTA-supplied IP addresses, allowing an attacker to inject text that the library interpreted as a valid server IP.
Original advisory description
References
- WEB https://github.com/SpamScope/mail-parser/security/advisories/GHSA-72px-j8gh-p79x
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-129297
- WEB https://github.com/SpamScope/mail-parser/pull/167
- WEB https://github.com/SpamScope/mail-parser/commit/ce3cf3559db1ff806bda598b378de9f8c2a5be96
- PACKAGE https://github.com/SpamScope/mail-parser
- WEB https://github.com/SpamScope/mail-parser/releases/tag/4.6.2
Source records: GHSA-72px-j8gh-p79x (OSV.dev) · EPSS by FIRST, 2026-11-21.