{"id":"CVE-2026-26209","published":"2026-03-23T18:53:10Z","modified":"2026-03-24T18:35:35Z","title":"cbor2 has a Denial of Service via Uncontrolled Recursion in cbor2.loads","vendor":"agronholm","product":"cbor2","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00754,"percentile":0.51285,"provenance":"source"},"cwes":[{"id":"CWE-674","name":"Uncontrolled Recursion"}],"references":[{"url":"https://github.com/agronholm/cbor2/security/advisories/GHSA-3c37-wwvx-h642","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/agronholm/cbor2/pull/275","tags":["x_refsource_MISC"]},{"url":"https://github.com/agronholm/cbor2/commit/e61a5f365ba610d5907a0ae1bc72769bba34294b","tags":["x_refsource_MISC"]},{"url":"https://github.com/agronholm/cbor2/releases/tag/5.9.0","tags":["x_refsource_MISC"]}],"priority":{"score":15.5,"factors":[{"name":"EPSS percentile","points":10.26},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"agronholm","affectedVersions":[{"vendor":"agronholm","product":"cbor2","versions":["< 5.9.0"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2026-03-24T18:35:22.617238Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"cbor2","vulnerableRanges":["<5.9.0"],"patched":["5.9.0"],"from":["GHSA-3c37-wwvx-h642","PYSEC-2026-2123"],"provenance":"source"}],"summary":{"text":"The cbor2 library's decoder (both the pure Python implementation and the _cbor2 C extension) lacks a hard nesting-depth limit, so decoding deeply nested CBOR structures via cbor2.loads() causes uncontrolled recursion. An unauthenticated remote attacker who can deliver a crafted payload of roughly 100,000 nested arrays to an application that decodes it can crash the worker process with a RecursionError, and repeating this with small packets produces a sustained denial of service; no user interaction or special configuration is described as required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:49:40Z"},"euvd":{"id":"EUVD-2026-14478","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-agronholm-cbor2-cve-2024-26134","parents":[{"from":"CVE-2025-68131","to":"CVE-2026-26209","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:cbor2","fromFixed":"5.8.0","toFixed":"5.9.0","daysApart":82},{"kind":"same-code","provenance":"machine","files":["cbor2/_decoder.py","source/decoder.c","source/decoder.h"],"commits":["https://github.com/agronholm/cbor2/commit/f1d701cd2c411ee40bb1fe383afe7f365f35abf0","https://github.com/agronholm/cbor2/commit/e61a5f365ba610d5907a0ae1bc72769bba34294b"],"basis":"shared function","functions":["CBORDecoder_new","__init__","decode"]}]},{"from":"CVE-2024-26134","to":"CVE-2026-26209","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["cbor2/_decoder.py","source/decoder.c"],"commits":["https://github.com/agronholm/cbor2/commit/387755eacf0be35591a478d3c67fe10618a6d542","https://github.com/agronholm/cbor2/commit/4de6991ba29bf2290d7b9d83525eda7d021873df","https://github.com/agronholm/cbor2/commit/e61a5f365ba610d5907a0ae1bc72769bba34294b"],"basis":"rarely changed file"}]}],"packageHistory":[{"cve":"CVE-2024-26134","published":"2024-02-19","fixed":"5.6.2","kev":false},{"cve":"CVE-2025-64076","published":"2025-11-18","fixed":"5.7.1","kev":false},{"cve":"CVE-2025-68131","published":"2025-12-31","fixed":"5.8.0","kev":false},{"cve":"CVE-2026-26209","published":"2026-03-23","fixed":"5.9.0","kev":false}],"package":"PyPI:cbor2"}}