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

High 7.5 Published Updated

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

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

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

Which versions are affected by CVE-2026-26209?

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

PackageAffectedFixed in
cbor2 PyPIAll versions5.9.0
cbor2 PyPIAll versions5.9.0
cbor2 PyPIAll versions5.9.0
Linux distribution packages (1)
python-cbor2 openSUSE:TumbleweedAll versions5.9.0-1.1

Products include Agronholm Cbor2.

How do I fix CVE-2026-26209?

Upgrade cbor2 to 5.9.0 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2026-26209 being exploited?

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

Sources

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 and 1 more.

Is CVE-2026-26209 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free