CVE-2026-129300: mail-parser: Uncaught `OverflowError` / `OSError` on an out-of-range `Received` date
mail-parser is a tool that parses emails by enhancing the Python standard library and extracting message details into a comprehensive object. From 3.7.0 until 4.6.3, receivedsformat() in src/mailparser/utils.py catches only TypeError and ValueError while converting the trailing date of an attacker-controlled Received header. An out-of-range year can cause calendar.timegm() to raise OverflowError, and a sufficiently large timezone offset can cause datetime.fromtimestamp() to raise OSError. These exceptions are outside the MailParserError hierarchy, so one crafted header can abort the entire message parse through every parsefrom entry point and may drop a queued batch. This issue is fixed in version 4.6.3.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
mail-parserto a version that resolves this vulnerability.Fixed in 4.6.3
Event History
Frequently Asked Questions
Who can exploit this issue?
An unauthenticated attacker who can supply an email for parsing can trigger it by placing a crafted trailing date in a Received header. The affected parsing paths include every parse_from_* entry point.
What is the operational impact?
A malformed Received date with an out-of-range year or a sufficiently large timezone offset can cause an uncaught OverflowError or OSError and abort parsing of the entire message. In queued processing, this may also cause a batch to be dropped.
Which versions should be remediated?
Versions from 3.7.0 up to, but not including, 4.6.3 are affected. Upgrade to version 4.6.3, which fixes the issue.