VAITP Dataset

← Back to the dataset

CVE-2026-126360

Quadratic‑time regex backtrack in TraceContext extractor can cause CPU exhaustion.

  • CVSS 5.3
  • CWE-1333
  • Resource Management
  • Remote

OpenTelemetry Python provides the Python API and SDK for OpenTelemetry. Prior to 1.45.2, TraceContextTextMapPropagator.extract() in opentelemetry-api can perform quadratic-time regular-expression backtracking on a malformed traceparent value containing a trace-context prefix, a long whitespace sequence, and an embedded newline. Exploitation requires an attacker-controlled carrier that preserves embedded newlines and permits a sufficiently large value, because conforming HTTP header values cannot contain embedded newlines. JSON-based carriers, including applicable MCP request metadata integrations, can preserve the required newline depending on the SDK, instrumentation, and message-size limits. Parsing on an asynchronous server's event-loop thread can consume excessive CPU and delay unrelated requests, while the advisory does not establish disclosure, modification, or code execution. This issue is fixed in version 1.45.2.

CVSS base score
5.3
Published
2026-11-12
OWASP
A06 Vulnerable and Outdated Components
Orthogonal defect classification
Timing/Serialization
Code defect classification
Timing Issues
Category
Resource Management
Subcategory
Resource Exhaustion
Accessibility scope
Remote
Impact
Denial of Service (DoS)
Affected component
OpenTelemetry Python
Fixed by upgrading
Yes

Solution

Upgrade OpenTelemetry Python to version 1.45.2 or later.

Vulnerable code sample

import re
from opentelemetry.propagate import TraceContextTextMapPropagator

def extract_context(headers: dict):
    # VULNERABLE: quadratic regex backtracking on malformed traceparent
    propagator = TraceContextTextMapPropagator()
    context = propagator.extract(headers)
    return context

Patched code sample

import re
from opentelemetry.propagate import TraceContextTextMapPropagator

def extract_context(headers: dict):
    # FIX: sanitize newline to prevent regex backtracking
    safe_headers = {k: v.replace("\n", " ") for k, v in headers.items()}
    propagator = TraceContextTextMapPropagator()
    context = propagator.extract(safe_headers)
    return context

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.

  • [release/v1.45.x-0.66bx] Backport metric cardinality limits and traceparent parsing (#5856) (open-telemetry/opentelemetry-python)
    docs/conf.py · on_missing_reference, exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py, exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py · PrometheusMetricReader.__init__, opentelemetry-api/src/opentelemetry/trace/propagation/tracecontext.py, opentelemetry-api/src/opentelemetry/trace/propagation/tracecontext.py · TraceContextTextMapPropagator.extract, opentelemetry-configuration/src/opentelemetry/configuration/_meter_provider.py, opentelemetry-configuration/src/opentelemetry/configuration/_meter_provider.py · _create_periodic_metric_reader, opentelemetry-configuration/src/opentelemetry/configuration/_meter_provider.py · _create_prometheus_metric_reader, opentelemetry-configuration/src/opentelemetry/configuration/_meter_provider.py · _create_pull_metric_exporter, opentelemetry-configuration/src/opentelemetry/configuration/_meter_provider.py · _create_pull_metric_reader, opentelemetry-configuration/src/opentelemetry/configuration/_meter_provider.py · _create_view, opentelemetry-sdk/src/opentelemetry/sdk/metrics/export/__init__.py and 16 more

Cite this entry

@misc{vaitp:cve2026126360,
  title        = {{Quadratic‑time regex backtrack in TraceContext extractor can cause CPU exhaustion.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-126360},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-126360/}}
}

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.