Intel

AIKIDO-2026-10375

ujson is vulnerable to Buffer Overflow (heap based)

Buffer Overflow (heap based)CVE-2026-32875 Published Mar 17, 2026

75

High Risk

This Affects:

PYTHONujson
5.2.0 - 5.11.0
Fixed in 5.12.0
Are you affected? Scan for Free

TL;DR

The encoder in ultrajsonenc.c reserves output buffer space using enc->indent * (enc->level + 1) with an int type. When indent or nesting is large enough, the product overflows and the reserved size is underestimated, so subsequent writes cause a heap buffer overflow. Separately, a negative indent value leads to size_t underflow in the same arithmetic; the buffer up-sizer can then enter an infinite loop. Both are reachable via ujson.dumps(obj, indent=...) or equivalent. The fix switches indent arithmetic to ptrdiff_t, caps positive indent at 1000 (raising ValueError above that), and clips negative indent to -1 while skipping indentation code paths so underflow and the infinite loop are avoided.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

ujson is vulnerable to Buffer Overflow (heap based) in versions 5.2.0 - 5.11.0.

How to fix this

Upgrade the ujson library to the patch version.