{"vuln_id":"GHSA-xhrq-2mqv-q8wx","aliases":["CVE-2026-129300","GHSA-24mq-4vc6-2prf"],"description":"mail-parser: Uncaught `OverflowError` / `OSError` on an out-of-range `Received` date","published_at":"2026-11-16T22:20:32Z","modified_at":"2026-11-16T22:20:33Z","first_seen_at":"2026-11-21T19:15:20.238586Z","severity":"medium","severity_source":"ghsa","cvss_score":5.3,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","cwe":["CWE-248"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-xhrq-2mqv-q8wx"},"matched_alias":null,"items":[{"id":2477,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-xhrq-2mqv-q8wx / CVE-2026-129300: mail-parser: Uncaught `OverflowError` / `OSError` on an out-of-range `Received` date","summary":"mail-parser: Uncaught `OverflowError` / `OSError` on an out-of-range `Received` date\n\n### 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:\nj[\"date_utc\"], _ = convert_mail_date(i[\"date\"])\nexcept (TypeError, ValueError, OverflowError, OSError):\nj[\"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)\n\nAffected packages: pip:mail-parser\nPatched: mail-parser 4.6.3","url":"https://github.com/advisories/GHSA-xhrq-2mqv-q8wx","published_at":"2026-11-16T22:20:32Z","updated_at":"2026-11-16T22:20:33Z","fetched_at":"2026-11-21T19:15:18.416868Z","severity":"medium","cvss_score":6.5,"epss":0.00396,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"mail-parser","vuln_id":"CVE-2026-129300","vuln_ids":["CVE-2026-129299","CVE-2026-129300","GHSA-24MQ-4VC6-2PRF","GHSA-XHRQ-2MQV-Q8WX"],"tags":["ghsa","pip","CWE-248"],"cluster_id":2398,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2477","html":"https://vulnwatch.ve1ve2.com/item/2477"}},{"id":6221,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-129300: mail-parser is a tool that parses emails by enhancing the Python standard library and extracting message details into a comprehensive object. From 3.7.0 until…","summary":"mail-parser is a tool that parses emails by enhancing the Python standard library and extracting message details into a comprehensive object. From 3.7.0 until 4.6.3, receiveds_format() in src/mailparser/utils.py catches only TypeError and ValueError while converting the trailing date of an attacker-controlled Received header. An out-of-range year can cause calendar.timegm() to raise OverflowError, and a sufficiently large timezone offset can cause datetime.fromtimestamp() to raise OSError. These exceptions are outside the MailParserError hierarchy, so one crafted header can abort the entire message parse through every parse_from_* entry point and may drop a queued batch. This issue is fixed in version 4.6.3.\n\nReferences:\nhttps://github.com/SpamScope/mail-parser/commit/d69f6f9b6ad0bf74d731b373bbdeabb462c32b26\nhttps://github.com/SpamScope/mail-parser/commit/e1d9fe6778045d6e2c44406bc8822e3464c1097f\nhttps://github.com/SpamScope/mail-parser/pull/171\nhttps://github.com/SpamScope/mail-parser/releases/tag/4.6.3\nhttps://github.com/SpamScope/mail-parser/security/advisories/GHSA-xhrq-2mqv-q8wx","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-129300","published_at":"2026-11-16T18:17:30.987000Z","updated_at":"2026-11-17T23:17:51.360000Z","fetched_at":"2026-11-21T19:15:31.481996Z","severity":"medium","cvss_score":5.3,"epss":0.00396,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-129300","vuln_ids":["CVE-2026-129300","GHSA-24MQ-4VC6-2PRF","GHSA-XHRQ-2MQV-Q8WX"],"tags":["CWE-248"],"cluster_id":1406,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/6221","html":"https://vulnwatch.ve1ve2.com/item/6221"}}]}