eml_parser has parser DoS via deeply nested parentheses in e-mail headersGHSA-m66c-fw79-6359
MEDIUMFix: GOVCERT-LU/eml_parser#90GHSA-m66c-fw79-6359 is a medium-severity (CVSS 5.3) CWE-770 vulnerability in eml-parser. A fix is available for eml-parser — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-m66c-fw79-6359.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
eml-parserReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Summary
eml_parser uses the email.utils.getaddresses() function from the CPython standard library to parse e-mail headers that contain e-mail addresses (such as To, Cc, Bcc, From, Reply-To, Sender, ...). When the input header contains a deeply nested CFWS (comment / folding white space) construct, the recursive descent parser in the standard library exhausts the call stack. The resulting RecursionError is not caught by eml_parser, so the exception propagates and aborts parsing of the whole message.
Impact
SOC pipelines use eml_parser to process untrusted e-mails. An attacker can easily create an eml file that will trigger the RecursionError during parsing.
The impact is mitigated by the fact that there are various other situations in which eml_parser will raise an exception when attempting to parse a malformed or pathological eml file. In particular, very deeply nested multipart e-mails also result in a RecursionError being raised by the library voluntarily. Therefore, systems relying on eml_parser already need to detect and handle errors emanating from the library in an appropriate way.
Workarounds
The issue can be avoided by wrapping the call to eml_parser.decode_email or eml_parser.decode_email_bytes in a try/except construct.
Patches
Since version 3.0.2, eml_parser will catch the error in the standard library parser and fall back to a simpler parser based on a regular expression.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | eml-parser | all versions | 3.0.2pip install --upgrade 'eml-parser==3.0.2' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for eml-parser, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update eml-parser to 3.0.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-m66c-fw79-6359 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This vulnerability is rated as having an Important severity because an unauthenticated remote attacker can trigger a denial of service by feeding malformed email headers into services relying on the eml_parser library. In environments where email processing pipelines ingest untrusted inbound messages automatically,…
To mitigate this issue, applications utilizing the `eml_parser` module for processing untrusted EML files should implement robust exception handling to gracefully manage `RecursionError` instances. Additionally, consider deploying `eml_parser` within isolated or sandboxed environments to limit the impact of potential denial of service attacks.Source: Red Hat security advisory for GHSA-m66c-fw79-6359 (CC BY 4.0)
Frequently Asked Questions
Is GHSA-m66c-fw79-6359 in your dependencies?
Find it across PyPI, including transitive dependencies.