CVE-2025-64076 Details
Description
Multiple vulnerabilities exist in cbor2 through version 5.7.0 in the decode_definite_long_string() function of the C extension decoder (source/decoder.c): (1) Integer Underflow Leading to Out-of-Bounds Read (CWE-191, CWE-125): An incorrect variable reference and missing state reset in the chunk processing loop causes buffer_length to not be reset to zero after UTF-8 character consumption. This results in subsequent chunk_length calculations producing negative values (e.g., chunk_length = 65536 - buffer_length), which are passed as signed integers to the read() method, potentially triggering unlimited read operations and resource exhaustion. (2) Memory Leak via Missing Reference Count Release (CWE-401): The main processing loop fails to release Python object references (Py_DECREF) for chunk objects allocated in each iteration. For CBOR strings longer than 65536 bytes, this causes cumulative memory leaks proportional to the payload size, enabling memory exhaustion attacks through repeated processing of large CBOR payloads. Both vulnerabilities can be exploited remotely without authentication by sending specially-crafted CBOR data containing definite-length text strings with multi-byte UTF-8 characters positioned at 65536-byte chunk boundaries. Successful exploitation results in denial of service through process crashes (CBORDecodeEOF exceptions) or memory exhaustion. The vulnerabilities affect all applications using cbor2's C extension to process untrusted CBOR data, including web APIs, IoT data collectors, and message queue processors. Fixed in commit 851473490281f82d82560b2368284ef33cf6e8f9 pushed with released version 5.7.1.
In the cbor2 library, all versions prior to 5.7.1, multiple vulnerabilities have been identified in the C extension decoder's decode_definite_long_string() function. These vulnerabilities include an integer underflow leading to an out-of-bounds read, and a memory leak caused by a failure to properly manage Python object references. The integer underflow occurs because an incorrect variable reference and a missing state reset in the chunk processing loop allow buffer_length to retain a value that results in negative calculations for chunk_length. This flaw can be exploited to create unlimited read operations, causing resource exhaustion. The memory leak arises from the same processing loop not releasing references for chunk objects, leading to cumulative memory leaks that can be exploited by processing large CBOR payloads. Both vulnerabilities can be exploited remotely without authentication by sending specially-crafted CBOR data with definite-length text strings that include multi-byte UTF-8 characters at the 65536-byte chunk boundaries. Exploitation of these vulnerabilities causes process crashes or memory exhaustion, affecting any application that uses cbor2's C extension to handle untrusted CBOR data, such as web APIs, IoT data collectors, and message queue processors.
Users can upgrade to cbor2 version 5.7.1, which addresses these vulnerabilities by correcting the chunk length calculation, releasing Python object references to prevent memory leaks, and adding test cases to ensure the issues are properly handled.
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 Nov 19, 2025References 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/851473490281f82d82560b2368284ef33cf6e8f9 | [email protected] | Patch |
| https://github.com/agronholm/cbor2/issues/264 | [email protected] | ExploitIssue Tracking |
| https://github.com/agronholm/cbor2/pull/265 | [email protected] | ExploitIssue TrackingPatch |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-191 | Integer Underflow (Wrap or Wraparound) | CISA-ADP |
Affected Products
| Product | Versions |
|---|---|
| agronholm cbor2 | <= 5.7.0 |
CPE
Remediation
| |
Change History
6 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Nov 5, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Dec 31, 2025 | Initial Analysis | [email protected] |
| Nov 19, 2025 | CVE Modified | CISA-ADP |
| Nov 18, 2025 | New CVE Received | [email protected] |