Intel

AIKIDO-2026-581554

ujson is vulnerable to Memory Leak

Memory LeakGHSA-8g3h-c45c-7pg3 Published Yesterday

37

Low Risk

This Affects:

PYTHONujson
4.2.0 - 5.13.0
Fixed in 6.0.0
Are you affected? Scan for Free

TL;DR

ujson's C encoder calls a user supplied default handler to convert objects it cannot serialize directly. When that handler keeps returning values it also cannot serialize, the encoder recurses to its depth limit and raises a TypeError without releasing the last object the handler returned. Each failed ujson.dumps() call leaks that object, so repeated serialization of such inputs grows process memory. The fix drops the outstanding reference on the encoder's error path.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you serialize objects with a custom default handler.

Background info

ujson is vulnerable to Memory Leak in versions 4.2.0 - 5.13.0.

How to fix this

Upgrade the ujson and/or the ultrajson library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform