CVE-2025-68131

7.5 HIGH

📋 TL;DR

This vulnerability in the cbor2 library allows attackers to read sensitive data from previously decoded CBOR messages when a CBORDecoder instance is reused across multiple decode operations. It affects applications that process untrusted CBOR data using cbor2 versions 3.0.0 through 5.7.0. The issue enables information disclosure across trust boundaries.

💻 Affected Systems

Products:
  • cbor2 Python library
Versions: 3.0.0 through 5.7.0
Operating Systems: All operating systems running Python
Default Config Vulnerable: ⚠️ Yes
Notes: Only vulnerable when CBORDecoder instances are reused across decode operations, particularly when processing untrusted data.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete disclosure of sensitive data from previous CBOR messages, potentially including authentication tokens, personal information, or cryptographic keys.

🟠

Likely Case

Partial information leakage from previously processed CBOR data, potentially exposing user data or application state.

🟢

If Mitigated

No data leakage if decoder instances are not reused across trust boundaries or proper version is used.

🌐 Internet-Facing: HIGH - Internet-facing applications processing untrusted CBOR data are directly exposed.
🏢 Internal Only: MEDIUM - Internal systems may be vulnerable if they process CBOR data from untrusted sources.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires the attacker to control CBOR input and the decoder must be reused. The vulnerability is well-documented in the advisory.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 5.8.0

Vendor Advisory: https://github.com/agronholm/cbor2/security/advisories/GHSA-wcj4-jw5j-44wh

Restart Required: No

Instructions:

1. Update cbor2 to version 5.8.0 or later using pip: pip install --upgrade cbor2>=5.8.0
2. Verify the update with: pip show cbor2
3. No application restart required for Python library updates.

🔧 Temporary Workarounds

Avoid decoder reuse

all

Create new CBORDecoder instances for each decode operation instead of reusing them, especially when processing untrusted data.

Isolate trusted/untrusted decoders

all

Use separate decoder instances for trusted and untrusted CBOR data sources.

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all CBOR data
  • Isolate CBOR processing to dedicated, ephemeral processes or containers

🔍 How to Verify

Check if Vulnerable:

Check cbor2 version with: python -c "import cbor2; print(cbor2.__version__)" and verify if between 3.0.0 and 5.7.0 inclusive.

Check Version:

python -c "import cbor2; print(cbor2.__version__)"

Verify Fix Applied:

Verify version is 5.8.0 or higher with: python -c "import cbor2; print(cbor2.__version__)"

📡 Detection & Monitoring

Log Indicators:

  • Unusual CBOR processing errors
  • Memory access patterns in CBOR decoding

Network Indicators:

  • Unexpected CBOR data patterns or sizes
  • Repeated CBOR decode operations from same source

SIEM Query:

Process monitoring for cbor2 library usage with version checks

🔗 References

📤 Share & Export