CVE-2026-129300: mail-parser Uncaught `OverflowError` / `OSError` On Vulnerability

MODERATE
Advisory Identifier: GHSA-xhrq-2mqv-q8wx
CVSS 5.3
CWE-248
Published
Advisory Summary

CVE-2026-129300 is a MODERATE (CVSS 5.3) uncaught `overflowerror` / `oserror` on vulnerability (CWE-248: Uncaught Exception) affecting mail-parser libraries in the PyPI ecosystem. The issue involves uncaught `overflowerror` / `oserror` on an out-of-range `received` date. Remediation is available by upgrading affected packages to version 4.6.3.

CVE-2026-129300 at a Glance

CVE Identifier CVE-2026-129300
GHSA Identifier GHSA-xhrq-2mqv-q8wx
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-248: Uncaught Exception
Affected Product mail-parser
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2026-129300

To remediate this vulnerability, upgrade all affected mail-parser dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mail-parser fixed: 4.6.3
pip install mail-parser>=4.6.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show mail-parser

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-129300, inspect your installed packages using pip:

pip show mail-parser

Analyze the terminal output to locate any version of mail-parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.6.3), your application is affected.

Note: The pip show mail-parser command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. In mail-parser, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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)

CVE-2026-129300 Affected mail-parser Versions

1 component(s)
Fixed Versions:
4.6.3
Product / Package Ecosystem Affected Versions Fixed Version
mail-parser
PyPI
≥ 3.7.0
< 4.6.3
4.6.3

References

Frequently Asked Questions

What is CVE-2026-129300?
CVE-2026-129300 is a security vulnerability in mail-parser involving Uncaught `OverflowError` / `OSError` on an out-of-range `Received` date under CWE-248: Uncaught Exception.
Which mail-parser versions are affected?
Affected versions include releases prior to 4.6.3 across affected packages: mail-parser.
What version fixes CVE-2026-129300?
Upgrading to 4.6.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mail-parser affected?
Yes, mail-parser is affected in releases prior to 4.6.3. Upgrade your dependency to 4.6.3 or later.
What is the CVSS score of CVE-2026-129300?
CVE-2026-129300 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2026-129300?
CVE-2026-129300 is classified under CWE-248: Uncaught Exception (An exception is thrown from a function, but it is not caught.).
How can I check PyPI dependencies for CVE-2026-129300?
Run the dependency tree command: 'pip show mail-parser'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xhrq-2mqv-q8wx",
  "modified" : "2026-11-16T22:20:32Z",
  "published" : "2026-11-16T22:20:32Z",
  "aliases" : [ "CVE-2026-129300" ],
  "summary" : "mail-parser: Uncaught `OverflowError` / `OSError` on an out-of-range `Received` date",
  "details" : "### Impact\n\nA `Received` header whose trailing date carries an out-of-range year, or a timezone offset\nlarge enough to push the timestamp past the int64 epoch range, raises an exception that is\n**outside the `MailParser*` hierarchy**. A caller that catches only mail-parser exceptions\ndoes not catch it, and the parse of the entire message is aborted — the same class of issue\nas [GHSA-24mq-4vc6-2prf](https://github.com/SpamScope/mail-parser/security/advisories/GHSA-24mq-4vc6-2prf),\nwhich this survives (it is not a duplicate; 24mq is fixed in 4.6.2 and this reproduces on 4.6.2).\n\nAll entry points are affected: `parse_from_string()`, `parse_from_bytes()`, `parse_from_file()`,\n`parse_from_file_obj()` and the `mail-parser` CLI. The header is fully attacker-controlled and\na single line is enough, so any pipeline that parses untrusted mail can be made to lose the\nmessage — and, if one worker handles a queue, to drop the batch.\n\n```python\nimport mailparser\n\nraw = (\"Received: from x ([1.2.3.4]) by mx.victim.com; \"\n       \"Tue, 7 Mar 292277026596 14:29:24 +0000\\r\\n\\r\\nbody\\r\\n\")\nmailparser.parse_from_string(raw).mail_json\n# <= 4.6.2 -> OverflowError: signed integer is greater than maximum\n# 4.6.3    -> parses; the unusable hop date is reported as \"date_utc\": null\n```\n\n**Root cause.** `receiveds_format()` in `src/mailparser/utils.py` guarded the date conversion\nwith `except (TypeError, ValueError)`, but `convert_mail_date()` → `email.utils.mktime_tz()` →\n`calendar.timegm()` raises `OverflowError` for years whose epoch seconds overflow int64, and\n`datetime.fromtimestamp()` reports `EOVERFLOW` as `OSError` for a sufficiently large timezone\noffset. The `date` and `timezone` properties already wrapped the same conversion in\n`except Exception`; only the `Received` path was left open.\n\n**Affected range.** Introduced by the date-handling change in `ca2aa6a`, first released in\n3.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`\nbefore the fix (Python 3.14). 3.6.0 is not affected.\n\n### Patches\n\nFixed in **4.6.3**. `receiveds_format()` now also catches `OverflowError` and `OSError` and\nrecords `date_utc = None` for that hop, so the rest of the message still parses:\n\n```python\ntry:\n    j[\"date_utc\"], _ = convert_mail_date(i[\"date\"])\nexcept (TypeError, ValueError, OverflowError, OSError):\n    j[\"date_utc\"] = None\n```\n\nA sweep of year magnitudes from 10^7 to 10^12 shows only `ValueError`, `OverflowError` and\n`OSError` are reachable on this path.\n\n### Workarounds\n\nUpgrade to 4.6.3. If you cannot upgrade, wrap every `parse_from_*` call in a bare\n`except Exception` rather than `except MailParserError`, and treat the message as unparsed.\n\n### References\n\n- Fix: https://github.com/SpamScope/mail-parser/pull/171\n- Related: [GHSA-24mq-4vc6-2prf](https://github.com/SpamScope/mail-parser/security/advisories/GHSA-24mq-4vc6-2prf)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "mail-parser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.7.0"
      }, {
        "fixed" : "4.6.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/SpamScope/mail-parser/security/advisories/GHSA-xhrq-2mqv-q8wx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-129300"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/SpamScope/mail-parser/pull/171"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/SpamScope/mail-parser/commit/d69f6f9b6ad0bf74d731b373bbdeabb462c32b26"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/SpamScope/mail-parser/commit/e1d9fe6778045d6e2c44406bc8822e3464c1097f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/SpamScope/mail-parser"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/SpamScope/mail-parser/releases/tag/4.6.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-16T22:20:32Z",
    "nvd_published_at" : "2026-11-16T18:17:30Z"
  }
}