All vulnerabilities

PyPI

CVE-2026-129299

mail-parser: Uncaught exceptions and silent header loss in mail-parser on attacker-controlled input

Severity
Medium 6.5
Published
16 Nov 2026
Last changed
16 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
4.6.2
Exploit chance
0.4% in the next 30 daysHigher than 29% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Uncaught exception (CWE-248)CWE-436
Attack
Over the network · No login needed · No user action needed
Attacker can
Change some data · Slow it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
Also known as
GHSA-24mq-4vc6-2prf
Sources
OSV.dev and GitHub

Description

Two effects, sharing the root cause of Advisory 1 — header names chosen by the sender were resolved through Python attribute lookup and rewritten before lookup.

Uncaught exceptions. A crafted message raises an exception that is outside the MailParser* hierarchy, so a caller catching only mail-parser exceptions does not catch it and the worker dies.

Header named after a method (CWE-248, reported by @iam-niranjan). Python resolves real class attributes before getattr, so a header named after a method put a bound method object into the parsed mail dict. A 12-byte email is sufficient. Nine colliding names were confirmed: Parse, Message, Write_Attachments, From_File, From_File_Obj, From_File_Msg, From_String, From_Bytes, Get_Server_Ipaddress. Also reproducible from the CLI (mail-parser -f evil.eml -j).

Header carrying 8-bit bytes (CWE-248). For a header containing raw 8-bit bytes, Python's compat32 policy returns an email.header.Header rather than a str, which the _raw accessor passed…

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

None for the data loss. For the uncaught exceptions, callers who cannot upgrade should wrap mail_json, mail_partial_json, headers_json and any X_raw access in a bare except Exception rather than catching only MailParserError subclasses.

Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
mail-parserPyPI · osv:PyPI:mail-parser
  • Every version before 4.6.2

About mail-parser

Weekly downloads (PyPI)
1,447,533PyPI Stats, 24 Nov 2026

References