Vulnerabilities in pkg:pypi/cbor2
PACKAGECVE-2025-64076 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-191: Integer Underflow (Wrap or Wraparound)) affecting Cbor2 libraries in the PyPI ecosystem. The issue involves cbor2 c extension decoder flaws can cause denial of service. Remediation is available by upgrading affected packages to version 5.7.1.
pkg:pypi/cbor2
Vulnerability advisories affecting package pkg:pypi/cbor2. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-9q9c-vjxh-p795 | CVE-2025-64076 | HIGH | cbor2 C extension decoder flaws can cause denial of service |
| GHSA-wcj4-jw5j-44wh | CVE-2025-68131 | MODERATE | CBORDecoder reuse can leak shareable values across decode calls |
| GHSA-3c37-wwvx-h642 | CVE-2026-26209 | HIGH | cbor2 has a Denial of Service via Uncontrolled Recursion in cbor2.loads |
| GHSA-375g-39jq-vq7m | CVE-2024-26134 | HIGH | Potential buffer overflow in CBOR2 decoder |
CVE-2025-64076 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2025-64076
To remediate this vulnerability, upgrade all affected Cbor2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install cbor2>=5.7.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show cbor2
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2025-64076, inspect your installed packages using pip:
pip show cbor2
Analyze the terminal output to locate any version of Cbor2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.7.1), your application is affected.
Note: The pip show cbor2 command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-191: Integer Underflow (Wrap or Wraparound), where the product subtracts one value from another, such that the result is less than the minimum allowable integer value, which produces a value that is not equal to the correct result. In Cbor2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-64076 Affected Cbor2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
cbor2
|
PyPI |
< 5.7.1
|
5.7.1
|
References
Frequently Asked Questions
What is CVE-2025-64076?
Which Cbor2 versions are affected?
What version fixes CVE-2025-64076?
Is cbor2 affected?
What is the CVSS score of CVE-2025-64076?
What CWE is associated with CVE-2025-64076?
How can I check PyPI dependencies for CVE-2025-64076?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9q9c-vjxh-p795",
"modified" : "2026-09-01T16:37:10Z",
"published" : "2025-11-18T18:32:55Z",
"aliases" : [ "CVE-2025-64076" ],
"summary" : "cbor2 C extension decoder flaws can cause denial of service",
"details" : "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): \n\n1. 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. \n2. 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. \n\nBoth 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "cbor2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.7.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-64076"
}, {
"type" : "WEB",
"url" : "https://github.com/agronholm/cbor2/issues/264"
}, {
"type" : "WEB",
"url" : "https://github.com/agronholm/cbor2/pull/265"
}, {
"type" : "WEB",
"url" : "https://github.com/agronholm/cbor2/commit/851473490281f82d82560b2368284ef33cf6e8f9"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/agronholm/cbor2"
}, {
"type" : "WEB",
"url" : "https://github.com/agronholm/cbor2/releases/tag/5.7.1"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/cbor2/PYSEC-2025-238.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-191" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-09-01T16:37:10Z",
"nvd_published_at" : "2025-11-18T18:16:14Z"
}
}