Intel

AIKIDO-2026-722661

mail-parser is vulnerable to Denial of Service (DoS)

Denial of Service (DoS)GHSA-xhrq-2mqv-q8wx Published 2 days ago

53

Medium Risk

This Affects:

PYTHONmail-parser
3.7.0 - 4.6.2
Fixed in 4.6.3
Are you affected? Scan for Free

TL;DR

receiveds_format() converts each Received-header hop date through convert_mail_date(), but only catches TypeError and ValueError. An out-of-range year whose epoch seconds overflow int64 raises OverflowError, and a large timezone offset raises OSError from datetime.fromtimestamp(). Those exceptions sit outside the MailParser* hierarchy, so every parse entry point (parse_from_string(), parse_from_bytes(), parse_from_file(), parse_from_file_obj(), and the CLI) aborts the entire message. A single attacker-controlled Received line is enough to drop that message, and a queue worker that handles one mail at a time can lose the batch. The fix also catches OverflowError and OSError and records date_utc = None for that hop so the rest of the message still parses.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and parse untrusted email with this library.

Background info

mail-parser is vulnerable to Denial of Service (DoS) in versions 3.7.0 - 4.6.2.

How to fix this

Upgrade the mail-parser library to the patch version.