CVE-2025-64076: n/a
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.
AI Analysis
Technical Summary
CVE-2025-64076 identifies two related vulnerabilities in the cbor2 Python library's C extension decoder, specifically within the decode_definite_long_string() function. The first vulnerability is an integer underflow caused by an incorrect variable reference and missing state reset in the chunk processing loop. This leads to the buffer_length variable not resetting after consuming UTF-8 characters, resulting in negative chunk_length calculations. These negative values are passed as signed integers to the read() method, potentially causing out-of-bounds reads and unlimited read operations that can exhaust resources. The second vulnerability is a memory leak due to the failure to release Python object references (Py_DECREF) for chunk objects allocated in each iteration of the main processing loop. For CBOR strings longer than 65536 bytes, this leak accumulates proportionally to the payload size, enabling memory exhaustion attacks. 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 (manifesting as 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. The issue was addressed and fixed in cbor2 version 5.7.1, which resets buffer_length correctly and ensures proper reference count decrementing to prevent leaks.
Potential Impact
For European organizations, the impact of CVE-2025-64076 can be significant, especially for those relying on cbor2 in critical systems such as IoT data collectors, web APIs, and message queue processors. Exploitation can cause denial of service conditions by crashing processes or exhausting system memory, leading to service outages and potential disruption of business operations. In sectors like manufacturing, energy, healthcare, and smart city infrastructure, where IoT devices and data processing pipelines are prevalent, such disruptions could affect operational continuity and safety. Additionally, denial of service in web APIs may degrade customer-facing services or internal applications, impacting reputation and compliance with service level agreements. Since exploitation requires no authentication and no user interaction, attackers can remotely target vulnerable systems with crafted CBOR payloads, increasing the risk of widespread impact if unpatched. The absence of known exploits in the wild currently limits immediate risk, but the high severity and ease of exploitation warrant proactive mitigation.
Mitigation Recommendations
European organizations should immediately upgrade to cbor2 version 5.7.1 or later to apply the official fix addressing both the integer underflow and memory leak vulnerabilities. For environments where immediate patching is not feasible, implement input validation and filtering to detect and block CBOR payloads containing definite-length text strings with multi-byte UTF-8 characters at 65536-byte chunk boundaries. Employ runtime monitoring to detect abnormal memory usage or process crashes related to CBOR decoding. Restrict network exposure of services processing untrusted CBOR data by applying network segmentation and firewall rules to limit access to trusted sources. Incorporate fuzz testing and static analysis in the development lifecycle to identify similar issues proactively. Finally, maintain up-to-date inventories of software dependencies to quickly identify and remediate vulnerable versions of cbor2 in the software supply chain.
Affected Countries
Germany, France, United Kingdom, Italy, Spain, Netherlands, Sweden, Belgium, Poland, Finland
CVE-2025-64076: n/a
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.
AI-Powered Analysis
Technical Analysis
CVE-2025-64076 identifies two related vulnerabilities in the cbor2 Python library's C extension decoder, specifically within the decode_definite_long_string() function. The first vulnerability is an integer underflow caused by an incorrect variable reference and missing state reset in the chunk processing loop. This leads to the buffer_length variable not resetting after consuming UTF-8 characters, resulting in negative chunk_length calculations. These negative values are passed as signed integers to the read() method, potentially causing out-of-bounds reads and unlimited read operations that can exhaust resources. The second vulnerability is a memory leak due to the failure to release Python object references (Py_DECREF) for chunk objects allocated in each iteration of the main processing loop. For CBOR strings longer than 65536 bytes, this leak accumulates proportionally to the payload size, enabling memory exhaustion attacks. 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 (manifesting as 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. The issue was addressed and fixed in cbor2 version 5.7.1, which resets buffer_length correctly and ensures proper reference count decrementing to prevent leaks.
Potential Impact
For European organizations, the impact of CVE-2025-64076 can be significant, especially for those relying on cbor2 in critical systems such as IoT data collectors, web APIs, and message queue processors. Exploitation can cause denial of service conditions by crashing processes or exhausting system memory, leading to service outages and potential disruption of business operations. In sectors like manufacturing, energy, healthcare, and smart city infrastructure, where IoT devices and data processing pipelines are prevalent, such disruptions could affect operational continuity and safety. Additionally, denial of service in web APIs may degrade customer-facing services or internal applications, impacting reputation and compliance with service level agreements. Since exploitation requires no authentication and no user interaction, attackers can remotely target vulnerable systems with crafted CBOR payloads, increasing the risk of widespread impact if unpatched. The absence of known exploits in the wild currently limits immediate risk, but the high severity and ease of exploitation warrant proactive mitigation.
Mitigation Recommendations
European organizations should immediately upgrade to cbor2 version 5.7.1 or later to apply the official fix addressing both the integer underflow and memory leak vulnerabilities. For environments where immediate patching is not feasible, implement input validation and filtering to detect and block CBOR payloads containing definite-length text strings with multi-byte UTF-8 characters at 65536-byte chunk boundaries. Employ runtime monitoring to detect abnormal memory usage or process crashes related to CBOR decoding. Restrict network exposure of services processing untrusted CBOR data by applying network segmentation and firewall rules to limit access to trusted sources. Incorporate fuzz testing and static analysis in the development lifecycle to identify similar issues proactively. Finally, maintain up-to-date inventories of software dependencies to quickly identify and remediate vulnerable versions of cbor2 in the software supply chain.
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- mitre
- Date Reserved
- 2025-10-27T00:00:00.000Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 691cb50331331b1c393fbbe2
Added to database: 11/18/2025, 6:03:47 PM
Last enriched: 11/18/2025, 6:13:08 PM
Last updated: 11/22/2025, 1:46:23 PM
Views: 20
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.
Related Threats
CVE-2024-0401: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in ASUS ExpertWiFi
HighCVE-2024-23690: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in Netgear FVS336Gv3
HighCVE-2024-13976: CWE-427 Uncontrolled Search Path Element in Commvault Commvault for Windows
HighCVE-2024-12856: CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in Four-Faith F3x24
HighCVE-2025-13526: CWE-200 Exposure of Sensitive Information to an Unauthorized Actor in walterpinem OneClick Chat to Order
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.