Skip to main content

UltraJSON (ujson) EUVDEUVD-2026-32663

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

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify service streaming JSON via ujson.dump()
  2. Delivery
    Send request generating large payload
  3. Exploit
    Abort connection mid-write to raise write() error
  4. Execution
    Serialized string leaks (no Py_DECREF)
  5. Persist
    Repeat across many connections
  6. Impact
    Exhaust server memory and crash process

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Resource cleanup, leak prevention
Exploitation Conditions

Exploitation requires that the target application specifically use ujson.dump() (the file-streaming API, not ujson.dumps()) to write to a file-like object whose write() method can be made to raise an exception under attacker influence - e.g. a network socket or response stream the attacker can close mid-write, or a sink that can be forced to error. The leak triggers only on that write-failure path, and each trigger leaks memory proportional to the serialized payload size, so large payloads amplify impact. Limiting factors: applications using ujson.dumps(), the standard json module, or only decode paths are not exploitable; the attacker needs a repeatable way to induce write failures and typically many iterations to exhaust memory; and impact is confined to availability (no data exposure or code execution). The CVSS PR:N/AV:N reflects the library's API surface, but real exposure depends on the downstream application's use of dump() to a failure-prone sink.

Impact

Signals are consistent and point to a real but low-urgency issue. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N) with VA:H and VC:N/VI:N produces a headline score of 8.7, driven entirely by availability impact - there is no confidentiality or integrity loss despite the 'Information Disclosure' tag in the intelligence feed, which appears mislabeled given the CWE-401 root cause and A-only impact. EPSS is only 0.04% (12th percentile) and the CVE is NOT on CISA KEV, so there is no evidence of mass or targeted exploitation. Critically, the CVSS AV:N/PR:N framing overstates practical reach: exploitation is not against ujson itself in a default configuration but is entirely contingent on a downstream application using ujson.dump() to stream to a client-controllable, failure-prone sink. This is a conditional, application-dependent DoS rather than a directly remotely-triggerable flaw in the library. Net: patch on a normal cycle; the 8.7 base score should not by itself force emergency response.

Exploit ScenarioDerived

A web application uses ujson.dump(response_obj, client_socket_writer) to stream JSON responses. An attacker repeatedly opens connections, issues requests that generate large JSON payloads, and abruptly closes the socket mid-response so write() raises an exception; each aborted request leaks the full serialized payload. Sustained over many connections this exhausts server memory and crashes the process. A proof-of-concept demonstrating the linear leak is published in the vendor advisory.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 23, 2026

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).

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.

Affected VersionsENISA

ultrajson < 5.12.1

Affected Packages

pypi ujson fix: 5.12.1
euvd ultrajson fix: 5.12.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in pypi, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

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.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

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
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

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

3
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

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.

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.

Executive ViewAI

Why It Matters

UltraJSON (ujson) versions 5.12.0 and earlier contain a memory exhaustion vulnerability with publicly available exploit code that allows attackers to crash JSON serialization operations by triggering repeated write failures. This directly impacts availability of applications that stream JSON responses, and organizations running vulnerable versions face service disruption risk from low-effort denial-of-service attacks.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.0%
Top 88% exploitable
Prevalence
High
widely used fast JSON library on PyPI across Python web services
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

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

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