CVE-2026-44660

UltraJSON: Memory Leak in ujson.dump() on Write Failure

Published May 27, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
Description
UltraJSON is a fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. Prior to 5.12.1, 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. This vulnerability is fixed in 5.12.1.

Analysis

AI-generated

Technical impact

UltraJSON encodes JSON strings in C and, before version 5.12.1, treats a write failure during ujson.dump() as a non‑cleanup path. The serialization buffer is not released when the underlying file write raises an exception, causing a memory leak that equals the full payload size for each failed write. This flaw can exhaust available memory, leading to denial of service for the process and potentially for the host if the process is privileged. The weakness is a classic resource management error (CWE‑401) and also reflects improper release of resources (CWE‑772).

Affected Systems

The vulnerable library is ultrajson:ultrajson, affecting all installations of UltraJSON prior to version 5.12.1 for Python 3.7 and later. The fix is included in release 5.12.1.

Risk and Exploitability

The CVSS score of 8.7 marks the vulnerability as high severity. Based on the description, it is inferred that an attacker who can control the file‑like destination or trigger a write error—such as by providing a disk‑full or unwritable file or manipulating I/O in a long‑running process—can most readily exploit the flaw. The EPSS score of 0.00052 indicates a very low probability of exploitation, and the issue is not listed in CISA KEV, suggesting that a known exploit is not publicly reported. Based on the description, it is inferred that the attack vector is local, requiring control over the process or environment that triggers a write error, and that local code execution or privilege escalation that enables usage of ujson.dump() would compound the risk.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade UltraJSON to version 5.12.1 or later.
  • Avoid writing serialized JSON to file‑like objects that may raise exceptions without proper error handling; use try‑except blocks to catch write errors before they lead to leak conditions.
  • Configure deployment environments to apply memory limits or container quotas to the Python processes using ujson.dump() in order to mitigate potential exhaustion effects.

Generated by OpenCVE AI on June 9, 2026 at 13:55 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-c38f-wx89-p2xg UltraJSON has a Memory Leak in ujson.dump() on Write Failure
History
Type Values Removed Values Added
First Time appeared Ultrajson Project
Ultrajson Project ultrajson
CPEs cpe:2.3:a:ultrajson_project:ultrajson:*:*:*:*:*:python:*:*
Vendors & Products Ultrajson Project
Ultrajson Project ultrajson
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Ultrajson
Ultrajson ultrajson
Vendors & Products Ultrajson
Ultrajson ultrajson
Type Values Removed Values Added
Description UltraJSON is a fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. Prior to 5.12.1, 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. This vulnerability is fixed in 5.12.1.
Title UltraJSON: Memory Leak in ujson.dump() on Write Failure
Weaknesses CWE-401
References
Metrics cvssV4_0

{'score': 8.7, 'vector': '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'}

Weaknesses
  • CWE-401

    Missing Release of Memory after Effective Lifetime

  • CWE-772

    Missing Release of Resource after Effective Lifetime

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
May 30, 2026, 1:49 AM
Reserved
May 7, 2026, 4:20 PM
Status
Analyzed
Published
May 27, 2026, 9:16 PM
Modified
Jun 17, 2026, 10:51 AM
Severity
Moderate
Public date
May 27, 2026, 8:42 PM