Intel

AIKIDO-2026-925863

cbor2 is vulnerable to Memory Leak

Memory LeakGHSA-x2xm-p98v-j3v7 Published 2 days ago

53

Medium Risk

This Affects:

PYTHONcbor2
5.6.0 - 5.8.0
Fixed in 5.9.0
Are you affected? Scan for Free

TL;DR

The C extension decoder in cbor2 decodes a definite-length text string larger than 64 KB by reading it in chunks and concatenating them. Each concatenation allocates a new combined string but the previous intermediate string is never released, so memory accumulates for every chunk and is retained for the lifetime of the process. Decoding untrusted CBOR text strings from a network source lets a caller retain large amounts of unreclaimed memory and eventually exhaust available resources. The fix releases each intermediate result before it is overwritten by the concatenated string.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you decode untrusted CBOR data using the C extension decoder.

Background info

cbor2 is vulnerable to Memory Leak in versions 5.6.0 - 5.8.0.

How to fix this

Upgrade the cbor2 library to the patch version.