mail-parser is vulnerable to Denial of Service (DoS)
53
Medium Risk
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.
You are affected if you are using a version that falls within the vulnerable range and parse untrusted email with this library.
mail-parser is vulnerable to Denial of Service (DoS) in versions 3.7.0 - 4.6.2.
Upgrade the mail-parser library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant