MEDIUM · CVSS 3.1 5.3 EPSS 0.5% · 38th percentile CWE-248

CVE-2026-129300: mail-parser: Uncaught `OverflowError` / `OSError` on an out-of-range `Received` date

Published 2026-11-16 · Updated 2026-11-16 · Also known as GHSA-xhrq-2mqv-q8wx

Summary

The mail-parser library fails to catch `OverflowError` and `OSError` exceptions when processing malformed or out-of-range `Received` header dates, leading to an uncaught exception that aborts message parsing. Engineering teams processing untrusted emails using versions 3.7.0 through 4.6.2 should upgrade immediately.

Who is affected

Applications utilizing PyPI package mail-parser versions 3.7.0 up to 4.6.2 are vulnerable to denial of service via message parsing failure. Because the `Received` header is fully attacker-controlled, a single malformed email containing an out-of-range year or large timezone offset will cause all entry points (`parse_from_string`, `parse_from_bytes`, `parse_from_file`, `parse_from_file_obj`, and the CLI) to raise an unhandled exception, causing message processing pipelines to drop the message or batch.

Exploitability

The vulnerability has a CVSS base score of 5.3 (Medium) with a vector of CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L, indicating network exploitability with low complexity and no privileges required, resulting in availability impact. The EPSS score is 0.004 (percentile 0.345) and CISA KEV status is no, meaning active exploitation in the wild is not documented.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-18. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
PyPI mail-parser >= 3.7.0, < 4.6.3 4.6.3 python -m pip install 'mail-parser>=4.6.3'

CVSS 3.1 vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Attack vectorNetwork
Attack complexityLow
Privileges requiredNone
User interactionNone
ScopeUnchanged
ConfidentialityNone
IntegrityNone
AvailabilityLow

FAQ

What causes the uncaught exception during parsing?

An out-of-range year or large timezone offset in the trailing date of a `Received` header causes `calendar.timegm()` or `datetime.fromtimestamp()` to raise `OverflowError` or `OSError`, which were not previously caught by mail-parser.

Is this vulnerability a duplicate of GHSA-24mq-4vc6-2prf?

No, this is a separate issue that survives the fix for GHSA-24mq-4vc6-2prf and reproduces on version 4.6.2.

Which versions of mail-parser are affected?

PyPI mail-parser introduced the vulnerability in version 3.7.0, and it affects all versions up to 4.6.2, while version 4.6.3 and later contain the fix.

Original advisory description
### Impact 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](https://github.com/SpamScope/mail-parser/security/advisories/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. ```python import mailparser raw = ("Received: from x ([1.2.3.4]) by mx.victim.com; " "Tue, 7 Mar 292277026596 14:29:24 +0000\r\n\r\nbody\r\n") mailparser.parse_from_string(raw).mail_json # <= 4.6.2 -> OverflowError: signed integer is greater than maximum # 4.6.3 -> parses; the unusable hop date is reported as "date_utc": null ``` **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. ### Patches 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: ```python 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. ### Workarounds 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. ### References - Fix: https://github.com/SpamScope/mail-parser/pull/171 - Related: [GHSA-24mq-4vc6-2prf](https://github.com/SpamScope/mail-parser/security/advisories/GHSA-24mq-4vc6-2prf)

References

Source records: GHSA-xhrq-2mqv-q8wx (OSV.dev) · EPSS by FIRST, 2026-11-26.