CVE-2025-64076
cbor2 C extension decoder flaws can cause denial of service
Also known as GHSA-9q9c-vjxh-p795, PYSEC-2025-238
Mitigation
- Upgrade cbor2 to 5.7.1 or later.
Who should check
- Projects that depend on PyPI package cbor2 (< 5.7.1)
- Anyone running n/a (versions: see the vendor advisory)
Vulnerability facts
- Affected
- cbor2 < 5.7.1
- Fixed in
- 5.7.1
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- Yes: see the exploit references below
- Remote exploitation
- Remote, no login needed
- CVSS
- 7.5 (v3.1, CNA)CVSS:3.1/AC:L/AV:N/A:H/C:N/I:N/PR:N/S:U/UI:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack complexity: Low
- Attack vector: Network
- Availability impact: High
- Confidentiality impact: None
- Integrity impact: None
- Privileges required: None
- Scope: Unchanged
- User interaction: None
- EPSS
- 0.92% chance of exploitation in 30 days (percentile 59, 2026-11-26)
- CWE
- CWE-191
- Modified
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| PyPI cbor2 | < 5.7.1 | 5.7.1 | osv |
| n/a | — | — | nvd |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2025-64076. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2025-64076.md Affected: cbor2 < 5.7.1 Fixed in: 5.7.1 Steps: 1. Search this machine and project for cbor2 (PyPI), n/a: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
Exploits and PoCs
FAQ
Is CVE-2025-64076 being exploited?
There is no confirmed exploitation: CVE-2025-64076 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 0.92% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2025-64076?
High: CVSS 7.5 (v3.1, scored by CNA). Remote, no login needed.
Which versions are affected by CVE-2025-64076?
cbor2 < 5.7.1.
Is there a fix for CVE-2025-64076?
Yes. Fixed in 5.7.1. Upgrade cbor2 to 5.7.1 or later.
How do I check if I'm affected by CVE-2025-64076?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.