CVE-2026-26209: CWE-674: Uncontrolled Recursion in agronholm cbor2
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.
AI Analysis
Technical Summary
The vulnerability identified as CVE-2026-26209 affects the cbor2 library, a Python package used for encoding and decoding Concise Binary Object Representation (CBOR) data. Versions before 5.9.0 do not impose a strict limit on the recursion depth when parsing nested CBOR structures. Specifically, an attacker can craft a CBOR payload containing roughly 100,000 nested arrays (denoted by the CBOR array start byte 0x81) that cause the decoding function cbor2.loads() to recurse deeply. The C extension module `_cbor2` relies on Python's internal recursion checks via Py_EnterRecursiveCall but does not implement its own data-driven depth limit. When the recursion limit is exceeded, Python raises a RecursionError, which crashes the worker process handling the decoding. This uncontrolled recursion leads to exhaustion of the call stack and results in a Denial of Service. This vulnerability impacts both the pure Python and C extension implementations of cbor2. In typical deployment scenarios, such as web servers (Gunicorn, Uvicorn) or task queues (Celery), an unhandled RecursionError terminates the worker process immediately, causing service disruption. The malicious payloads are relatively small (<100KB), making exploitation feasible over network connections. The vulnerability was publicly disclosed on March 23, 2026, with a CVSS v3 score of 7.5 (high severity), reflecting its network attack vector, low complexity, no privileges or user interaction required, and high impact on availability. The issue is fixed in cbor2 version 5.9.0 by implementing appropriate recursion depth controls or other mitigations to prevent stack exhaustion.
Potential Impact
This vulnerability primarily impacts the availability of applications using vulnerable versions of cbor2 for CBOR data processing. By sending crafted deeply nested CBOR payloads, attackers can repeatedly crash worker processes in web servers or task queues, leading to sustained Denial of Service conditions. This can disrupt critical services relying on CBOR serialization, including APIs, microservices, and distributed task processing systems. The relatively small size of malicious payloads facilitates network-based exploitation without requiring authentication or user interaction. Organizations running Python applications that decode CBOR data with cbor2 versions prior to 5.9.0 are at risk of service outages. The impact is especially severe in high-availability environments where worker process crashes degrade performance or cause downtime. Although no data confidentiality or integrity issues are reported, the loss of availability can affect business continuity, user experience, and operational stability. The vulnerability could be leveraged in targeted attacks or automated scanning campaigns to disrupt services at scale.
Mitigation Recommendations
To mitigate this vulnerability, organizations should upgrade all instances of the cbor2 library to version 5.9.0 or later, where the issue is patched. If immediate upgrade is not feasible, implement application-level input validation to reject CBOR payloads with suspiciously deep nesting or excessive complexity before decoding. Employ runtime monitoring and alerting for RecursionError exceptions or frequent worker process crashes to detect exploitation attempts early. Configure web servers and task queues to gracefully handle worker failures, such as automatic restarts with backoff, to reduce downtime. Consider sandboxing or isolating CBOR decoding operations to limit impact on critical processes. Additionally, review and harden Python interpreter recursion limits and stack size settings to balance security and performance. Network-level protections like rate limiting and filtering of CBOR traffic can reduce exposure to malicious payloads. Finally, maintain up-to-date dependency inventories and vulnerability scanning to ensure timely patching of cbor2 and related components.
Affected Countries
United States, Germany, United Kingdom, France, Japan, South Korea, China, Canada, Australia, Netherlands, Sweden, India
CVE-2026-26209: CWE-674: Uncontrolled Recursion in agronholm cbor2
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.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability identified as CVE-2026-26209 affects the cbor2 library, a Python package used for encoding and decoding Concise Binary Object Representation (CBOR) data. Versions before 5.9.0 do not impose a strict limit on the recursion depth when parsing nested CBOR structures. Specifically, an attacker can craft a CBOR payload containing roughly 100,000 nested arrays (denoted by the CBOR array start byte 0x81) that cause the decoding function cbor2.loads() to recurse deeply. The C extension module `_cbor2` relies on Python's internal recursion checks via Py_EnterRecursiveCall but does not implement its own data-driven depth limit. When the recursion limit is exceeded, Python raises a RecursionError, which crashes the worker process handling the decoding. This uncontrolled recursion leads to exhaustion of the call stack and results in a Denial of Service. This vulnerability impacts both the pure Python and C extension implementations of cbor2. In typical deployment scenarios, such as web servers (Gunicorn, Uvicorn) or task queues (Celery), an unhandled RecursionError terminates the worker process immediately, causing service disruption. The malicious payloads are relatively small (<100KB), making exploitation feasible over network connections. The vulnerability was publicly disclosed on March 23, 2026, with a CVSS v3 score of 7.5 (high severity), reflecting its network attack vector, low complexity, no privileges or user interaction required, and high impact on availability. The issue is fixed in cbor2 version 5.9.0 by implementing appropriate recursion depth controls or other mitigations to prevent stack exhaustion.
Potential Impact
This vulnerability primarily impacts the availability of applications using vulnerable versions of cbor2 for CBOR data processing. By sending crafted deeply nested CBOR payloads, attackers can repeatedly crash worker processes in web servers or task queues, leading to sustained Denial of Service conditions. This can disrupt critical services relying on CBOR serialization, including APIs, microservices, and distributed task processing systems. The relatively small size of malicious payloads facilitates network-based exploitation without requiring authentication or user interaction. Organizations running Python applications that decode CBOR data with cbor2 versions prior to 5.9.0 are at risk of service outages. The impact is especially severe in high-availability environments where worker process crashes degrade performance or cause downtime. Although no data confidentiality or integrity issues are reported, the loss of availability can affect business continuity, user experience, and operational stability. The vulnerability could be leveraged in targeted attacks or automated scanning campaigns to disrupt services at scale.
Mitigation Recommendations
To mitigate this vulnerability, organizations should upgrade all instances of the cbor2 library to version 5.9.0 or later, where the issue is patched. If immediate upgrade is not feasible, implement application-level input validation to reject CBOR payloads with suspiciously deep nesting or excessive complexity before decoding. Employ runtime monitoring and alerting for RecursionError exceptions or frequent worker process crashes to detect exploitation attempts early. Configure web servers and task queues to gracefully handle worker failures, such as automatic restarts with backoff, to reduce downtime. Consider sandboxing or isolating CBOR decoding operations to limit impact on critical processes. Additionally, review and harden Python interpreter recursion limits and stack size settings to balance security and performance. Network-level protections like rate limiting and filtering of CBOR traffic can reduce exposure to malicious payloads. Finally, maintain up-to-date dependency inventories and vulnerability scanning to ensure timely patching of cbor2 and related components.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-02-11T19:56:24.814Z
- Cvss Version
- 3.0
- State
- PUBLISHED
Threat ID: 69c18de6f4197a8e3b82dd7b
Added to database: 3/23/2026, 7:00:54 PM
Last enriched: 3/23/2026, 7:17:29 PM
Last updated: 3/24/2026, 6:41:14 AM
Views: 12
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.