CVE-2026-26209
Python vulnerability analysis and mitigation

Overview

CVE-2026-26209 is a Denial of Service (DoS) vulnerability in the cbor2 Python library caused by uncontrolled recursion when decoding deeply nested CBOR structures. It affects all versions of cbor2 prior to 5.9.0 (≤ 5.8.0), including both the pure Python implementation and the C extension _cbor2. The vulnerability was discovered by Kevin Tu of TMIR at ByteDance, published on March 22–23, 2026, and patched in version 5.9.0. It carries a CVSS v3.0 base score of 7.5 (High) (GitHub Advisory, Red Hat Bugzilla).

Technical details

The root cause is uncontrolled recursion (CWE-674) combined with allocation of resources without limits or throttling (CWE-770) in the CBORDecoder class. The decode_array and decode_map methods recursively call self.decode() for each nested element without enforcing a data-driven depth limit. The C extension uses Python's Py_EnterRecursiveCall for recursion protection, which raises a RecursionError when the interpreter's global recursion limit is hit rather than applying an independent, configurable depth cap. An attacker can craft a CBOR payload of approximately 100,000 nested single-element arrays (0x81 bytes), each under 100KB, to reliably exhaust the Python stack and trigger a RecursionError. The fix in version 5.9.0 introduces a max_depth decoder parameter with a default of 400 nesting levels (GitHub Advisory, cbor2 Release 5.9.0).

Impact

Successful exploitation causes an unhandled RecursionError that immediately terminates the Python worker process parsing the malicious payload. In common deployment environments such as Gunicorn, Uvicorn, or Celery task queues, this results in a complete and sustained Denial of Service for the application. By repeatedly sending small (<100KB) crafted packets, an attacker can crash worker processes faster than they can be restarted, with no impact on confidentiality or integrity. Applications using cbor2 to parse untrusted data — including IoT data processing, WebAuthn/FIDO2 authentication flows, and COSE inter-service communication — are particularly at risk (GitHub Advisory, Red Hat Bugzilla).

Exploitability

A proof-of-concept (PoC) exploit is publicly available in the GitHub security advisory, consisting of a short Python script that triggers a RecursionError locally via cbor2.loads() with a crafted nested-array payload. The vulnerability requires no authentication, no user interaction, and is exploitable over the network with low attack complexity. The EPSS score is approximately 0.045% (low probability of near-term exploitation). There is no evidence of in-the-wild exploitation or CISA KEV catalog listing as of the time of this report. The vulnerability is detected by Qualys (IDs 5009546, 6634839) and Nessus (plugin 305837) (GitHub Advisory, Feedly).

Exploitation steps

  1. Reconnaissance: Identify services that accept CBOR-encoded input and use the cbor2 library (version ≤ 5.8.0) for deserialization — common targets include REST APIs, WebAuthn endpoints, IoT gateways, or message queue consumers.
  2. Craft the malicious payload: Construct a deeply nested CBOR array payload by repeating the single-element array byte 0x81 thousands of times, followed by a terminal value byte 0x01. For example: payload = b'\x81' * DEPTH + b'\x01' where DEPTH is set to 1000 or more (approximately 100,000 for maximum effect).
  3. Deliver the payload: Submit the crafted payload to the target endpoint via HTTP POST, WebSocket message, MQTT publish, or any other channel that feeds data into cbor2.loads() or cbor2.load().
  4. Trigger the crash: When the server-side cbor2 decoder processes the payload, it recursively descends into nested arrays without a depth limit, hitting Python's maximum recursion depth and raising an unhandled RecursionError that terminates the worker process.
  5. Sustain the DoS: Repeatedly send the payload (each <100KB) to crash new worker processes as they restart, maintaining a sustained Denial of Service condition (GitHub Advisory).

Indicators of compromise

  • Logs: Python tracebacks containing RecursionError: maximum recursion depth exceeded originating from cbor2/_decoder.py or the _cbor2 C extension in application logs; repeated worker process restart events in Gunicorn, Uvicorn, or Celery logs.
  • Network: Repeated inbound requests to CBOR-consuming endpoints with small payloads (<100KB) in rapid succession; payloads beginning with long sequences of the byte 0x81.
  • Process: Sudden, repeated termination and restart of Python worker processes (e.g., Gunicorn workers, Celery workers) without other apparent cause; elevated process crash rates correlated with specific source IPs or request patterns.
  • File System: Core dump files generated by crashed Python worker processes, if core dumps are enabled on the host (GitHub Advisory, Red Hat Bugzilla).

Mitigation and workarounds

The primary remediation is to upgrade cbor2 to version 5.9.0 or later, which introduces a max_depth decoder parameter (default: 400 levels) that enforces a hard nesting limit independent of Python's global recursion setting. As interim workarounds, operators should implement rate limiting on endpoints that accept CBOR input, deploy a reverse proxy or WAF to detect and block abnormally structured payloads, and configure automatic worker process restart mechanisms to reduce downtime during an attack. IBM has also addressed this in Cloudera Data Platform Private Cloud Base 7.3.2 (cbor2 Release 5.9.0, IBM Advisory).

Community reactions

The vulnerability was credited to Kevin Tu of TMIR at ByteDance and patched by the library maintainer @agronholm. Red Hat tracked the issue via Bugzilla (Bug 2450422) and issued errata (RHSA-2026:16174, RHSA-2026:16009). The OpenEmbedded/meta-openembedded project backported the patch for embedded Linux distributions. SUSE also issued security updates for python-cbor2. Social media activity was limited, with brief mentions on Mastodon and Bluesky shortly after disclosure (Red Hat Bugzilla, GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-48039CRITICAL9.1
  • Python logoPython
  • meta-ads-mcp
NoYesAug 07, 2026
CVE-2026-48169HIGH8.8
  • Python logoPython
  • praisonai-platform
NoYesAug 07, 2026
GHSA-wvpp-8hx9-p66jHIGH8.8
  • Python logoPython
  • gitpython
NoYesAug 07, 2026
CVE-2026-71870MEDIUM4.8
  • Python logoPython
  • pypdf
NoYesAug 07, 2026
CVE-2026-71852MEDIUM4.8
  • Python logoPython
  • pypdf
NoYesAug 07, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management