# CVE-2026-26209: cbor2 has a Denial of Service via Uncontrolled Recursion in cbor2.loads

> An attacker can cause a Denial of Service by sending deeply nested CBOR payloads that trigger uncontrolled recursion and crash the application.

- **Severity:** High 7.5 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 23 Mar 2026
- **Updated:** 24 Mar 2026
- **Also known as:** AZL-80541, DEBIAN-CVE-2026-26209, GHSA-3c37-wwvx-h642, PYSEC-2026-2123, ROOT-APP-PYPI-CVE-2026-26209, UBUNTU-CVE-2026-26209, openSUSE-SU-2026:10425-1

## What is CVE-2026-26209?

CVE-2026-26209 is a high-severity denial of service vulnerability in agronholm cbor2, published on 23 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-674 (Uncontrolled Recursion)

## Which versions are affected by CVE-2026-26209?

3 open source packages ship an affected version, including cbor2. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `cbor2` | PyPI | All versions | 5.9.0 |
| `cbor2` | PyPI | All versions | 5.9.0 |
| `cbor2` | PyPI | All versions | 5.9.0 |
| `python-cbor2` | openSUSE:Tumbleweed | All versions | 5.9.0-1.1 |

Products: Agronholm Cbor2.

## How do I fix CVE-2026-26209?

Upgrade cbor2 to 5.9.0 or later.

## Is CVE-2026-26209 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-26209 exists.

## Other vulnerabilities in agronholm cbor2

- [CVE-2025-64076](https://insights.sbomify.com/CVE-2025-64076/): cbor2 C extension decoder flaws can cause denial of service (high 7.5)
- [CVE-2024-26134](https://insights.sbomify.com/CVE-2024-26134/): CBOR2 decoder has potential buffer overflow (high 7.5)
- [CVE-2025-68131](https://insights.sbomify.com/CVE-2025-68131/): CBORDecoder reuse can leak shareable values across decode calls (medium 5.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-26209 and fix it if it is affected.

What it is: CVE-2026-26209 is a high-severity denial of service vulnerability in agronholm cbor2, published on 23 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-26209 exists.

Affected packages and fixed versions:
- cbor2 (PyPI): affected all versions; fixed in 5.9.0
- cbor2 (PyPI): affected all versions; fixed in 5.9.0
- cbor2 (PyPI): affected all versions; fixed in 5.9.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-26209/ (Markdown: https://insights.sbomify.com/CVE-2026-26209/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-26209
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-26209
- OSV: https://osv.dev/vulnerability/CVE-2026-26209

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-26209/
Summaries are generated and may contain mistakes; the official description above is the record.
