eml_parser vulnerable to DoS via deeply nested parens in Received headers
High severity
GitHub Reviewed
Published
Jun 15, 2026
in
GOVCERT-LU/eml_parser
•
Updated Aug 25, 2026
Description
Published to the GitHub Advisory Database
Aug 25, 2026
Reviewed
Aug 25, 2026
Last updated
Aug 25, 2026
Summary
eml_parserstrips parenthesised CFWS comments fromReceived:headers using a regex-based fix-point loop. The loop has quadratic time complexity in the number of nested parens. A singleReceived:header containing 5,000 nested parens causes ~1.3 seconds of CPU saturation per parsed message; runtime quadruples per doubling of nesting depth.Impact
This represents a CPU exhaustion DoS in any pipeline that processes attacker-supplied EML files. An attacker can create relatively small EML files that will take multiple seconds to parse.
This is particularly problematic for synchronous email-processing pipelines (gateways, sandboxes, real-time triage) where worker latency directly translates to queue backpressure and possible service-level outages.
Patches
Since version 3.0.2,
eml_parseruses a linear-time algorithm to remove the comments fromReceived:headers.References