GHSA-m66c-fw79-6359: Medium severity pip/eml_parser vulnerability

Published Aug 25, 2026
·
Updated

Summary

emlparser 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 emlparser, so the exception propagates and aborts parsing of the whole message.

Impact

SOC pipelines use emlparser 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 emlparser 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 emlparser 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 emlparser.decodeemail or emlparser.decodeemailbytes in a try/except construct.

Patches

Since version 3.0.2, emlparser will catch the error in the standard library parser and fall back to a simpler parser based on a regular expression.

Affected Software

1 affected componentFixes available
pip/eml_parser<3.0.2
3.0.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/eml_parser to a version that resolves this vulnerability.

    Fixed in 3.0.2
  2. Upgrade

    Upgrade eml_parser to a version that resolves this vulnerability.

    Fixed in 3.0.2
  3. Configuration

    Wrap calls to eml_parser.decode_email and eml_parser.decode_email_bytes in a try/except construct, because the resulting RecursionError is not caught by eml_parser and otherwise propagates to abort parsing of the whole message.

    SOC pipeline using eml_parser Wrap decode calls in try/except = try/except around eml_parser.decode_email and eml_parser.decode_email_bytes

Event History

Aug 25, 2026
Advisory Published
via GitHub·06:25 PM
Data Sourced
via GitHub·06:25 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are realistically exposed to this issue?

Systems that use eml_parser to process untrusted e-mail messages, such as SOC pipelines, are exposed. A crafted message containing deeply nested comment or folding-whitespace constructs in address-bearing headers can abort parsing.

2

What does an attacker need to do to trigger the failure?

The attacker needs to supply an EML file with a deeply nested CFWS construct in a header parsed as e-mail addresses, including headers such as To, Cc, Bcc, From, Reply-To, or Sender. No authentication or user interaction is indicated by the supplied severity vector.

3

What can be done if an update cannot be applied immediately?

Wrap eml_parser calls so that exceptions, including RecursionError, are detected and handled rather than allowed to abort processing. This is also appropriate for other malformed or pathological messages, since deeply nested multipart messages can already cause RecursionError.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203