CVE-2026-26209 Details
Description
cbor2 provides encoding and decoding for the Concise Binary Object Representation (CBOR) serialization format. Versions prior to 5.9.0 are vulnerable to a Denial of Service (DoS) attack caused by uncontrolled recursion when decoding deeply nested CBOR structures. This vulnerability affects both the pure Python implementation and the C extension `_cbor2`. The C extension relies on Python's internal recursion limits `Py_EnterRecursiveCall` rather than a data-driven depth limit, meaning it still raises `RecursionError` and crashes the worker process when the limit is hit. While the library handles moderate nesting levels, it lacks a hard depth limit. An attacker can supply a crafted CBOR payload containing approximately 100,000 nested arrays `0x81`. When `cbor2.loads()` attempts to parse this, it hits the Python interpreter's maximum recursion depth or exhausts the stack, causing the process to crash with a `RecursionError`. Because the library does not enforce its own limits, it allows an external attacker to exhaust the host application's stack resource. In many web application servers (e.g., Gunicorn, Uvicorn) or task queues (Celery), an unhandled `RecursionError` terminates the worker process immediately. By sending a stream of these small (<100KB) malicious packets, an attacker can repeatedly crash worker processes, resulting in a complete Denial of Service for the application. Version 5.9.0 patches the issue.
A denial-of-service vulnerability has been identified in the cbor2 library, which provides encoding and decoding for the Concise Binary Object Representation (CBOR) serialization format. This issue affects versions of cbor2 through 5.8.0, including both the pure Python implementation and the C extension '_cbor2'. The vulnerability arises from uncontrolled recursion when decoding deeply nested CBOR structures, allowing an attacker to craft a payload with approximately 100,000 nested arrays. When the 'cbor2.loads()' function processes this payload, it exceeds Python's maximum recursion depth, leading to a 'RecursionError' and crashing the worker process. In many web application servers or task queues, such an unhandled 'RecursionError' immediately terminates the worker process, causing a complete denial-of-service for the application.
Users can upgrade to cbor2 version 5.9.0 or later, which addresses this vulnerability by introducing a configurable maximum depth limit for decoding nested structures. Instructions for upgrading can be found in the cbor2 version 5.9.0 release notes.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Mar 24, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/agronholm/cbor2/commit/e61a5f365ba610d5907a0ae1bc72769bba34294b | [email protected] | Patch |
| https://github.com/agronholm/cbor2/pull/275 | [email protected] | Issue TrackingPatch |
| https://github.com/agronholm/cbor2/releases/tag/5.9.0 | [email protected] | ProductRelease Notes |
| https://github.com/agronholm/cbor2/security/advisories/GHSA-3c37-wwvx-h642 | [email protected] | ExploitVendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-674 | Uncontrolled Recursion | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| agronholm cbor2 | < 5.9.0 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Mar 25, 2026 | Initial Analysis | [email protected] |
| Mar 23, 2026 | New CVE Received | [email protected] |