CVE-2026-116588
Excessive backtracking in query-string regex causes CPU spikes in Datadog APM.
- CVSS 8.7
- CWE-1333
- Resource Management
- Remote
Datadog dd-trace-py is the Datadog Python APM client. From 1.5.0 until 3.19.9 and 4.15.6, the default query-string obfuscation regular expression can exhibit excessive backtracking while synchronously processing attacker-controlled URL query strings for HTTP span metadata. A remote attacker can cause prolonged CPU consumption, request latency, and service unavailability in affected HTTP tracing integrations that include query strings in URL span tags. The vulnerable processing is enabled by default for those integrations. This issue is fixed in versions 3.19.9 and 4.15.6.
- CWE
- CWE-1333
- CVSS base score
- 8.7
- Published
- 2026-10-26
- OWASP
- A04 Insecure Design
- 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
- dd-trace-py
- Fixed by upgrading
- Yes
Solution
Upgrade dd‑trace‑py to ≥ 3.19.9 or ≥ 4.15.6.
Vulnerable code sample
import re
from ddtrace import tracer
from ddtrace.internal.utils.http import _default_obfuscation_query_string_re
def trace_request(url: str) -> None:
# VULNERABLE: catastrophic backtracking on attacker‑controlled query strings
query = url.split('?', 1)[1] if '?' in url else ''
# The library uses the default regex which can exhibit exponential backtracking
sanitized = _default_obfuscation_query_string_re.sub(lambda m: '*****', query)
tracer.trace("http.request", resource=url, tags={"http.query": sanitized})Patched code sample
import re
from ddtrace import tracer
from ddtrace.internal.utils.http import _default_obfuscation_query_string_re
def trace_request(url: str) -> None:
# FIX: replace vulnerable regex with a safe, linear‑time pattern
query = url.split('?', 1)[1] if '?' in url else ''
safe_re = re.compile(r'[^&=]+=[^&]*')
sanitized = safe_re.sub(lambda m: '*****', query)
tracer.trace("http.request", resource=url, tags={"http.query": sanitized})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.
- fix(tracing): prevent quadratic query string obfuscation [backport 3.19] (#20880) (DataDog/dd-trace-py)
ddtrace/contrib/internal/ray/patch.py · traced_submit_job,ddtrace/contrib/internal/ray/utils.py · get_signature,ddtrace/contrib/internal/trace_utils_base.py · _set_url_tag,ddtrace/internal/dist_computing/utils.py · in_ray_job,ddtrace/internal/utils/http.py,ddtrace/internal/utils/http.py · redact_query_string,ddtrace/internal/utils/http.py · redact_url,ddtrace/settings/_config.py,ddtrace/settings/_config.py · Config.__init__,scripts/gen_gitlab_config.py,scripts/gen_gitlab_config.py · gen_pre_checks,scripts/gen_gitlab_config.py · JobSpec.__str__ - fix(tracing): prevent quadratic query string obfuscation [backport 4.15] (#20862) (DataDog/dd-trace-py)
ddtrace/appsec/_iast/_evidence_redaction/url_sensitive_analyzer.py,ddtrace/appsec/_iast/_evidence_redaction/url_sensitive_analyzer.py · find_query_string_matches,ddtrace/contrib/internal/trace_utils_base.py · _set_url_tag,ddtrace/internal/settings/_config.py,ddtrace/internal/settings/_config.py · Config.__init__,ddtrace/internal/utils/http.py,ddtrace/internal/utils/http.py · redact_query_string,ddtrace/internal/utils/http.py · redact_url - fix(tracing): prevent quadratic query string obfuscation (#20857) (DataDog/dd-trace-py)
ddtrace/internal/settings/_config.py · Config.__init__
Cite this entry
@misc{vaitp:cve2026116588,
title = {{Excessive backtracking in query-string regex causes CPU spikes in Datadog APM.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-116588},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-116588/}}
}
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 ::
