CVE catalog

CVE-2025-64076

cbor2: CVE-2025-64076

[CVE catalog]

Severity
High · CVSS 7.5CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Published
Source
[NVD] · [CVE record]
EPSS
0.49% · Oct 25, 2026

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.

Vulnerable and fixed packages

Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.

DistributionPackageReleaseVersionStatus
Debiancbor2sid6.1.2-2fixed
Debiancbor2forky6.1.2-2fixed
Debiancbor2trixie5.6.5-1vulnerable
Debiancbor2bookworm5.4.6-1not affected
PyPIcbor2Not reported5.7.1fixed
Pipcbor2Not reported5.7.1fixed
Ubuntucbor222.045.2.0-4vulnerable
Ubuntucbor222.045.2.0-4build1vulnerable
Ubuntucbor222.045.4.2-1vulnerable
Ubuntucbor222.045.4.2-1build1vulnerable
Ubuntucbor224.045.4.6-2vulnerable
Ubuntucbor224.045.4.6-2build1vulnerable
Ubuntucbor224.045.5.1-1vulnerable
Ubuntucbor224.045.6.0-1vulnerable
Ubuntucbor224.045.6.1-1vulnerable
Ubuntucbor224.045.6.2-1vulnerable
Ubuntucbor224.045.6.2-1build1vulnerable
Ubuntucbor225.105.6.5-1build1vulnerable

Fixed-version evidence

DistributionPackageTypeReleaseFixed versionUrgencyOriginBugs
Debiancbor2sourcesid5.7.1-1unimportantNot reportedNot reported
Debiancbor2sourceforky5.7.1-1unimportantNot reportedNot reported
Debiancbor2sourcetrixie(unfixed)unimportantNot reportedNot reported
Debiancbor2sourcebookwormNot affectedunimportantNot reportedNot reported
PyPIcbor2PyPINot reported5.7.1Not reportedPYSEC-2025-238Not reported
Pipcbor2pipNot reported5.7.1Not reportedGHSA-9Q9C-VJXH-P795Not reported

OpenFactory catalog packages

[Debian 13 (Trixie)]

  • [python3-cbor2]Affected

    Source package: [cbor2]

    Details (4)
    • 5.6.5-1 · amd64 · trixie

      Affected

      dsa · cbor2 · debian · 13

    • 5.6.5-1 · arm64 · trixie

      Affected

      dsa · cbor2 · debian · 13

    • 5.9.0-2~bpo13+2 · amd64 · trixie-backports

      Affected

      dsa · cbor2 · debian · 13

    • 5.9.0-2~bpo13+2 · arm64 · trixie-backports

      Affected

      dsa · cbor2 · debian · 13

  • Source package: [cbor2]

    Details (4)
    • 5.6.5-1 · all · trixie

      Affected

      dsa · cbor2 · debian · 13

    • 5.6.5-1 · all · trixie

      Affected

      dsa · cbor2 · debian · 13

    • 5.9.0-2~bpo13+2 · all · trixie-backports

      Affected

      dsa · cbor2 · debian · 13

    • 5.9.0-2~bpo13+2 · all · trixie-backports

      Affected

      dsa · cbor2 · debian · 13

[Debian 12 (Bookworm)]

  • [python3-cbor2]Not affected

    Source package: [cbor2]

    Details (2)
    • 5.4.6-1+b1 · amd64 · bookworm

      Not affected

      dsa · cbor2 · debian · bookworm

    • 5.4.6-1+b1 · arm64 · bookworm

      Not affected

      dsa · cbor2 · debian · bookworm

  • [python-cbor2-doc]Not affected

    Source package: [cbor2]

    Details (2)
    • 5.4.6-1 · all · bookworm

      Not affected

      dsa · cbor2 · debian · bookworm

    • 5.4.6-1 · all · bookworm

      Not affected

      dsa · cbor2 · debian · bookworm

Observed:

References