mail-parser: Uncaught `OverflowError` / `OSError` on an out-of-range `Received` date
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| SpamScopemail-parser | — | Not listed |
| pipmail-parser |
< 4.6.3→ 4.6.3 |
4.6.3 |
| PyPImail-parser |
≥ 3.7.0, < 4.6.3→ 4.6.3 |
4.6.3 |
Original description The description as published by the source.
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.
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory nvd.nist.gov
- advisory github.com
- package github.com
- patch github.com
- patch github.com
- patch github.com
- REDHAT Red Hat
- web github.com
- web github.com