Skip to content

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

HighCVSS 7.5 EPSS 0.49%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: no · technical impact: partial
Technology
UbuntuDebian

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.

Upgrade path

6 packages: 3 fixed, 3 with no fix yet.

PackageAffectedFixed inStatus
debian/cbor2(Debian 13) = 5.6.5-1; = 5.7.0-1; = 5.7.1-1; = 5.8.0-1 +9 more No fix listed No fix yet
ubuntu/cbor2(Ubuntu 22.04) All versions No fix listed No fix yet
ubuntu/cbor2(Ubuntu 24.04) All versions No fix listed No fix yet
agronholm cbor2 <= 5.7.0 after 5.7.0 Fixed
debian/cbor2(Debian 14) < 5.7.1-1; = 5.6.5-1; = 5.7.0-1 5.7.1-1 Fixed
pypi cbor2(PyPI) < 5.7.1; = 1.0.0; = 1.1.0; = 2.0.0 +35 more 5.7.1 Fixed

Affected products

ProductAffected versionsFixed in
pypi cbor2(PyPI) < 5.7.1 5.7.1
pypi cbor2(PyPI) = 1.0.0 No fix listed
pypi cbor2(PyPI) = 1.1.0 No fix listed
pypi cbor2(PyPI) = 2.0.0 No fix listed
pypi cbor2(PyPI) = 3.0.0 No fix listed
pypi cbor2(PyPI) = 3.0.1 No fix listed
pypi cbor2(PyPI) = 3.0.2 No fix listed
pypi cbor2(PyPI) = 3.0.3 No fix listed
pypi cbor2(PyPI) = 3.0.4 No fix listed
pypi cbor2(PyPI) = 4.0.0 No fix listed
pypi cbor2(PyPI) = 4.0.1 No fix listed
pypi cbor2(PyPI) = 4.1.0 No fix listed
pypi cbor2(PyPI) = 4.1.1 No fix listed
pypi cbor2(PyPI) = 4.1.2 No fix listed
pypi cbor2(PyPI) = 5.0.0 No fix listed
pypi cbor2(PyPI) = 5.0.1 No fix listed
pypi cbor2(PyPI) = 5.1.0 No fix listed
pypi cbor2(PyPI) = 5.1.1 No fix listed
pypi cbor2(PyPI) = 5.1.2 No fix listed
pypi cbor2(PyPI) = 5.2.0 No fix listed
pypi cbor2(PyPI) = 5.2.0.post1 No fix listed
pypi cbor2(PyPI) = 5.3.0 No fix listed
pypi cbor2(PyPI) = 5.4.0 No fix listed
pypi cbor2(PyPI) = 5.4.1 No fix listed
pypi cbor2(PyPI) = 5.4.2 No fix listed
Show 33 more
ProductAffected versionsFixed in
pypi cbor2(PyPI) = 5.4.2.post1 No fix listed
pypi cbor2(PyPI) = 5.4.3 No fix listed
pypi cbor2(PyPI) = 5.4.4 No fix listed
pypi cbor2(PyPI) = 5.4.5 No fix listed
pypi cbor2(PyPI) = 5.4.6 No fix listed
pypi cbor2(PyPI) = 5.5.0 No fix listed
pypi cbor2(PyPI) = 5.5.1 No fix listed
pypi cbor2(PyPI) = 5.6.0 No fix listed
pypi cbor2(PyPI) = 5.6.1 No fix listed
pypi cbor2(PyPI) = 5.6.2 No fix listed
pypi cbor2(PyPI) = 5.6.3 No fix listed
pypi cbor2(PyPI) = 5.6.4 No fix listed
pypi cbor2(PyPI) = 5.6.5 No fix listed
pypi cbor2(PyPI) = 5.7.0 No fix listed
debian/cbor2(Debian:13) All versions No fix listed
debian/cbor2(Debian:13) = 5.6.5-1 No fix listed
debian/cbor2(Debian:13) = 5.7.0-1 No fix listed
debian/cbor2(Debian:13) = 5.7.1-1 No fix listed
debian/cbor2(Debian:13) = 5.8.0-1 No fix listed
debian/cbor2(Debian:13) = 5.8.0-2 No fix listed
debian/cbor2(Debian:13) = 5.8.0-3 No fix listed
debian/cbor2(Debian:13) = 5.9.0-1 No fix listed
debian/cbor2(Debian:13) = 5.9.0-2 No fix listed
debian/cbor2(Debian:13) = 5.9.0-2~bpo13+1 No fix listed
debian/cbor2(Debian:13) = 5.9.0-2~bpo13+2 No fix listed
debian/cbor2(Debian:13) = 6.1.2-1 No fix listed
debian/cbor2(Debian:13) = 6.1.2-2 No fix listed
debian/cbor2(Debian:14) < 5.7.1-1 5.7.1-1
debian/cbor2(Debian:14) = 5.6.5-1 No fix listed
debian/cbor2(Debian:14) = 5.7.0-1 No fix listed
ubuntu/cbor2(Ubuntu:22.04) All versions No fix listed
ubuntu/cbor2(Ubuntu:24.04) All versions No fix listed
agronholm cbor2 <= 5.7.0 No fix listed

References