VAITP Dataset

← Back to the dataset

CVE-2026-55620

Quadratic regex loop in eml_parser routing causes CPU blowup with deep parentheses.

  • CVSS 7.5
  • CWE-770
  • Resource Management
  • Remote

eml_parser serves as a python module for parsing eml files and returning various information found in the e-mail as well as computed information. Prior to 3.0.2, eml_parser.routing.noparenthesis in eml_parser/routing.py removes parenthesized CFWS comments from Received: headers with a regex-based fix-point loop whose running time is quadratic in the nesting depth. A single Received: header with 5,000 nested parentheses causes approximately 1.3 seconds of CPU saturation per parsed message, and doubling the nesting depth approximately quadruples the running time. An attacker can submit relatively small EML files that consume multiple seconds of processing time, causing worker latency, queue backpressure, and possible service-level outages in synchronous gateways, sandboxes, and real-time triage pipelines. This issue is fixed in version 3.0.2.

CVSS base score
7.5
Published
2026-08-25
OWASP
A04 Insecure Design
Orthogonal defect classification
Algorithm
Code defect classification
Incorrect Algorithm
Category
Resource Management
Subcategory
Resource Exhaustion
Accessibility scope
Remote
Impact
Denial of Service (DoS)
Affected component
eml_parser
Fixed by upgrading
Yes

Solution

Upgrade eml_parser to version 3.0.2 or later.

Vulnerable code sample

import re

def strip_cfws(received_header: str) -> str:
    """
    Remove parenthesized CFWS comments from a Received: header.
    """
    # VULNERABLE: quadratic fix‑point regex loop on nested parentheses
    pattern = re.compile(r'\([^()]*\)')
    # repeatedly strip innermost parentheses until none remain
    while pattern.search(received_header):
        received_header = pattern.sub('', received_header)
    return received_header

Patched code sample

import re

def strip_cfws(received_header: str) -> str:
    """
    Remove parenthesized CFWS comments from a Received: header.
    """
    # FIX: linear scan removes all parentheses without quadratic looping
    result = []
    depth = 0
    for ch in received_header:
        if ch == '(':
            depth += 1
            continue
        if ch == ')':
            if depth:
                depth -= 1
            continue
        if depth == 0:
            result.append(ch)
    return ''.join(result)

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • Address security advisories (#90) (GOVCERT-LU/eml_parser)
    eml_parser/parser.py · CustomPolicy.header_fetch_parse, eml_parser/parser.py · EmlParser.clean_found_uri, eml_parser/parser.py · EmlParser.parse_email, eml_parser/parser.py · EmlParser.__init__, eml_parser/regexes.py, eml_parser/routing.py · noparenthesis

Cite this entry

@misc{vaitp:cve202655620,
  title        = {{Quadratic regex loop in eml_parser routing causes CPU blowup with deep parentheses.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-55620},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-55620/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.