MAIL-PARSER · CVE-2026-129300 · Package
FIX → 4.6.3
A crafted Received header with an out-of-range year or timezone offset makes mail-parser raise an OverflowError or OSError that is not a MailParser exception, so callers catching only library errors lose the whole message. An attacker who can send mail to a system that parses it can make parsing abort and, in a queue worker, drop the batch.
first public Aug 19, 2026 · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Any application that parses untrusted email with mail-parser 3.7.0 up to but not including 4.6.3 is exposed, including the mail-parser CLI. Exposure is worse when the caller catches only MailParserError, because the uncaught exception aborts parsing of the whole message. Systems that parse only trusted mail, or that already catch broad exceptions, are less exposed.
Not affected if trusted-mail-only, version-4.6.3-or-later, version-below-3.7.0
Who cares email-pipeline, mail-parser, python
pip show mail-parser; versions from >= 3.7.0 and before 4.6.3 are affected.parse_from_string, parse_from_bytes, parse_from_file or parse_from_file_obj on untrusted mail, and check whether the exception handling catches only MailParserError.A Received header whose trailing date carries an out-of-range year, or a timezone offset
large enough to push the timestamp past the int64 epoch range, raises an exception that is
outside the MailParser* hierarchy. A caller that catches only mail-parser exceptions
does not catch it, and the parse of the entire message is aborted — the same class of issue
as GHSA-24mq-4vc6-2prf,
which this survives (it is not a duplicate; 24mq is fixed in 4.6.2 and this reproduces on 4.6.2).
All entry points are affected: parse_from_string(), parse_from_bytes(), parse_from_file(),
parse_from_file_obj() and the mail-parser CLI. The header is fully attacker-controlled and
a single line is enough, so any pipeline that parses untrusted mail can be made to lose the
message — and, if one worker handles a queue, to drop the batch.
import mailparser
raw = ("Received: from x ([1.2.3.4]) by mx.victim.com; "
)
mailparser.parse_from_string(raw).mail_json
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.
Upgrade to 4.6.3
mail-parser 4.6.3 (the fixed version per the product data; the fix also records the hop date as None and keeps parsing).Root cause. receiveds_format() in src/mailparser/utils.py guarded the date conversion
with except (TypeError, ValueError), but convert_mail_date() → email.utils.mktime_tz() →
calendar.timegm() raises OverflowError for years whose epoch seconds overflow int64, and
datetime.fromtimestamp() reports EOVERFLOW as OSError for a sufficiently large timezone
offset. The date and timezone properties already wrapped the same conversion in
except Exception; only the Received path was left open.
Affected range. Introduced by the date-handling change in ca2aa6a, first released in
3.7.0. Reproduced on PyPI 3.7.0, 3.8.0, 3.9.3, 4.0.0, 4.5.0, 4.6.0, 4.6.2 and on master
before the fix (Python 3.14). 3.6.0 is not affected.
Fixed in 4.6.3. receiveds_format() now also catches OverflowError and OSError and
records date_utc = None for that hop, so the rest of the message still parses:
try:
j["date_utc"], _ = convert_mail_date(i["date"])
except (TypeError, ValueError, OverflowError, OSError):
j["date_utc"] = None
A sweep of year magnitudes from 10^7 to 10^12 shows only ValueError, OverflowError and
OSError are reachable on this path.
Upgrade to 4.6.3. If you cannot upgrade, wrap every parse_from_* call in a bare
except Exception rather than except MailParserError, and treat the message as unparsed.
This page as .md · .json · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD data is provided by NIST and is public domain · GitHub Advisory Database, CC-BY 4.0. Posts quoted belong to their authors.