# CVE-2025-64076: cbor2 C extension decoder flaws can cause denial of service

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.5
- **CVSS:** 7.5 (v3.1, CNA) `CVSS:3.1/AC:L/AV:N/A:H/C:N/I:N/PR:N/S:U/UI:N`
- **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
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.92% (percentile 59, 2026-11-26)
- **CWE:** CWE-191
- **Aliases:** GHSA-9q9c-vjxh-p795, PYSEC-2025-238
- **Published:** 2025-11-18T00:00:00.000Z
- **Modified:** 2026-11-05T14:10:00.273Z

## Who should check

- Projects that depend on PyPI package cbor2 (\< 5.7.1)
- Anyone running n/a (versions: see the vendor advisory)

## 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

- PyPI `cbor2`: affected \< 5.7.1; fixed 5.7.1 (osv)
- n/a: see vendor advisory (nvd)

## Mitigation

- Upgrade cbor2 to 5.7.1 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
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.
```

## 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.

## References

- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2025-64076>
- vendor: <https://github.com/advisories/GHSA-9q9c-vjxh-p795>
- patch: <https://github.com/agronholm/cbor2/pull/265>
- patch: <https://github.com/agronholm/cbor2/commit/851473490281f82d82560b2368284ef33cf6e8f9>
- exploit: <https://github.com/agronholm/cbor2/issues/264>
- other: <https://github.com/agronholm/cbor2>
- other: <https://github.com/agronholm/cbor2/releases/tag/5.7.1>
- other: <https://github.com/pypa/advisory-database/tree/main/vulns/cbor2/PYSEC-2025-238.yaml>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-64076>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-9q9c-vjxh-p795> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2025-238> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2025-64076> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-64076>
