CVE-2026-145573: UltraJSON 4.2.0 before 6.0.0 Memory Leak via ujson.dumps() default Handler
UltraJSON 4.2.0 before 6.0.0 contains a memory leak in ObjectbeginTypeContext() that fails to release objects returned by a caller-supplied default handler. Attackers who can repeatedly trigger encoding of values whose default handler returns non-serializable objects leak one object per failed call, gradually exhausting process memory.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.0.0
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Deployments using UltraJSON versions 4.2.0 through versions before 6.0.0 are affected when they use ujson.dumps() with a caller-supplied default handler. The leak requires that handler to return a non-serializable object.
What does an attacker need to do to exploit the leak?
An attacker must be able to repeatedly cause encoding of values that reach the caller-supplied default handler and cause it to return non-serializable objects. Each failed encoding call leaks one object, so exploitation depends on repeated triggering over time.
Is a default ujson.dumps() configuration affected?
The available information identifies the vulnerable path as a caller-supplied default handler. It does not indicate that calls without such a handler trigger this leak.
What is the remediation?
Upgrade UltraJSON to version 6.0.0 or later. If upgrading is not immediately possible, avoid or restrict untrusted requests that can repeatedly invoke a default handler returning non-serializable objects.