CVE-2026-114603
CPU‑intensive regex backtracking in TraceState.from_header leads to DoS.
- CVSS 5.3
- CWE-400
- Resource Management
- Remote
OpenTelemetry Python provides the Python API and SDK for OpenTelemetry. Prior to 1.45.1, the opentelemetry-api function TraceState.from_header in opentelemetry/trace/span.py, reached through TraceContextTextMapPropagator.extract, parses inbound W3C tracestate headers with an unbounded optional-whitespace regular expression. A malformed header containing a long run of spaces or tabs without a following comma causes quadratic backtracking before the member-count limit is applied. Services using the default W3C Trace Context propagator can therefore spend excessive CPU time on one unauthenticated request when the HTTP server, parser, gateway, or custom carrier accepts a sufficiently large header. The processing can occupy a synchronous worker or delay unrelated requests on the same asynchronous event loop. The impact is limited to availability and does not expose or modify telemetry data or allow code execution. This issue is fixed in version 1.45.1.
- CWE
- CWE-400
- CVSS base score
- 5.3
- Published
- 2026-10-22
- 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.1 or later.
Vulnerable code sample
import re
from typing import List, Tuple
# Simulated simplified version of TraceState.from_header
def parse_tracestate(header: str) -> List[Tuple[str, str]]:
"""
Parses a W3C tracestate header into a list of (key, value) tuples.
Vulnerable to catastrophic backtracking when the header contains
a long run of whitespace without commas.
"""
# VULNERABLE: unbounded optional-whitespace regex causes quadratic backtracking
parts = re.split(r',\s*', header.strip())
entries: List[Tuple[str, str]] = []
for part in parts:
if not part:
continue
# Using a regex with an unbounded optional whitespace before the equals sign
m = re.match(r'([^=]+)\s*=\s*(.*)', part)
if m:
key, value = m.group(1).strip(), m.group(2).strip()
entries.append((key, value))
return entriesPatched code sample
import re
from typing import List, Tuple
# Simulated simplified version of TraceState.from_header
def parse_tracestate(header: str) -> List[Tuple[str, str]]:
"""
Parses a W3C tracestate header into a list of (key, value) tuples.
Fixed by avoiding unbounded optional-whitespace regex that can backtrack.
"""
# FIX: use a bounded split and simple string operations to avoid regex backtracking
parts = header.strip().split(',')
entries: List[Tuple[str, str]] = []
for part in parts:
if not part:
continue
# Split on the first '=' and strip surrounding whitespace explicitly
if '=' in part:
key, value = part.split('=', 1)
entries.append((key.strip(), value.strip()))
return entriesPublished 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.
- opentelemetry-api: improve performance of tracestate parsing (#5746) (#5749) (open-telemetry/opentelemetry-python)
opentelemetry-api/src/opentelemetry/trace/propagation/tracecontext.py,opentelemetry-api/src/opentelemetry/trace/propagation/tracecontext.py · TraceContextTextMapPropagator.extract,opentelemetry-api/src/opentelemetry/trace/span.py,opentelemetry-api/src/opentelemetry/trace/span.py · TraceState.from_header
Cite this entry
@misc{vaitp:cve2026114603,
title = {{CPU‑intensive regex backtracking in TraceState.from_header leads to DoS.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-114603},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-114603/}}
}
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 ::
