Skip to main content

UltraJSON (ujson) CVE-2026-44660

| EUVDEUVD-2026-32663 HIGH
Memory Leak (CWE-401)
2026-05-12 https://github.com/ultrajson/ultrajson GHSA-c38f-wx89-p2xg
8.7
CVSS 4.0 · GitHub Advisory
Share

Severity by source

GitHub Advisory PRIMARY
8.7 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
vuln.today AI
5.9 MEDIUM

Availability-only DoS reachable over the network without auth, but exploitation depends on the app streaming via dump() to an attacker-failable sink and needs repeated triggers, so AC:H; no C/I impact.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE
7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Red Hat
7.5 MEDIUM
qualitative

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
X

Lifecycle Timeline

5
Source Code Evidence Fetched
Jul 23, 2026 - 19:06 vuln.today
Analysis Generated
Jul 23, 2026 - 19:06 vuln.today
CVSS changed
May 27, 2026 - 21:22 NVD
8.7 (HIGH)
CVE Published
May 12, 2026 - 22:25 github-advisory
HIGH 8.7
CVE Published
May 12, 2026 - 22:25 nvd
HIGH

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 9 pypi packages depend on ujson (6 direct, 3 indirect)

Ecosystem-wide dependent count for version 5.12.1.

DescriptionGitHub Advisory

Summary

When ujson.dump() writes to a file-like object and the write operation raises an exception, the serialized JSON string object is not decremented, leaking memory. Each failed write operation leaks the full size of the serialized payload.

Code that uses ujson.dumps() rather than ujson.dump() or only JSON load/decode methods is unaffected.

Details

Vulnerability Location:

  • src/ujson/python/objToJSON.c:913 - objToJSONFile() function start
  • src/ujson/python/objToJSON.c:931 - Error return on write failure
  • src/ujson/python/objToJSON.c:942 - Early return without cleanup

Root Cause:

The objToJSONFile() function allocates a Python string object via ujson_dumps_internal(), calls the file's write() method, and returns early if write() raises an exception-but never calls Py_DECREF(string) on the early exit path.

PoC

python
import gc, tracemalloc, ujson

class BadFile:
    def write(self, s):
        raise RuntimeError("boom")

obj = {"x": "A" * 200000}

def run():
    try:
        ujson.dump(obj, BadFile())
    except RuntimeError:
        pass

run()
tracemalloc.start()
gc.collect()
base = tracemalloc.get_traced_memory()[0]

for i in range(5):
    run()
    gc.collect()
    cur = tracemalloc.get_traced_memory()[0]
    print(i, cur - base)

Impact

Any application that serializes data through ujson.dump() to an attacker-influenced file-like object that can fail can be driven into linear memory growth. An attacker can quickly use up all the memory of say a web server that sends JSON responses using ujson.dump() by repeatedly making requests then closing the connection mid response.

Remediation

The missing dec-refs were added in 82af1d0ac01d09aa40c887b460d44b9d9f4bccd9. We recommend upgrading to UltraJSON 5.12.1.

Workarounds

Replacing ujson.dump(obj, file) with file.write(ujson.dumps(obj)) is equivalent (contrary to popular misconception, there are no streaming benefits to using ujson.dump()) and will avoid the memory leak.

AnalysisAI

Denial-of-service via memory exhaustion affects UltraJSON (ujson) versions 5.12.0 and earlier, where the ujson.dump() function fails to release (Py_DECREF) the serialized JSON string object when the target file-like object's write() method raises an exception. Each failed write leaks the full serialized payload, so an attacker who can repeatedly trigger write failures - for example by disconnecting mid-response from a web server that streams JSON via ujson.dump() - can drive linear, unbounded memory growth. A proof-of-concept exists in the vendor advisory (GHSA-c38f-wx89-p2xg), but there is no public exploit identified as weaponized and no active exploitation; EPSS is very low at 0.04% (12th percentile).

Technical ContextAI

UltraJSON is a fast C-extension JSON encoder/decoder for CPython, widely used as a drop-in replacement for the standard json module. The flaw is CWE-401 (Missing Release of Memory after Effective Lifetime) in the C source at src/ujson/python/objToJSON.c. The objToJSONFile() function (line 913) allocates a Python string object through ujson_dumps_internal(), then invokes the file object's write() method. On the error paths (line 931 write failure, line 942 early return) the function returns NULL without calling Py_DECREF on that string, so the reference count never drops to zero and CPython's garbage collector cannot reclaim the buffer. Only the file-streaming API ujson.dump() is affected; ujson.dumps() (which returns a string) and all load/decode paths are unaffected. The fix (commit 82af1d0) adds the missing Py_DECREF(string) calls on the early-exit branches plus a Py_XDECREF guard when the argument tuple allocation fails.

RemediationAI

Upgrade UltraJSON to version 5.12.1 or later (Vendor-released patch: 5.12.1), available at https://github.com/ultrajson/ultrajson/releases/tag/5.12.1 with the fix in commit 82af1d0ac01d09aa40c887b460d44b9d9f4bccd9. If immediate upgrade is not possible, the vendor-documented workaround is to replace 'ujson.dump(obj, file)' with 'file.write(ujson.dumps(obj))', which is functionally equivalent (there are no streaming benefits to ujson.dump()) and avoids the leaking code path entirely - the only trade-off is that the entire serialized string is materialized in memory before writing, which is already the case internally. As a defensive measure for services that must keep using dump(), monitor process memory and enforce per-process memory limits (e.g., cgroups/ulimit) so a leak-driven growth is capped and the worker is recycled rather than exhausting host memory; the trade-off is dropped in-flight requests when a worker is restarted.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Affected
SUSE Linux Enterprise Module for Development Tools 15 SP7 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP7 Affected
SUSE Linux Enterprise Server 15 SP7 Affected

Share

CVE-2026-44660 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy