CVE-2026-44660: UltraJSON Memory Leak on Write Failure in ujson.dump()

ujson Updated 13 May 2026

Summary

12/05/2026
Yes i
High
8.7

CVE-2026-44660: UltraJSON has a Memory Leak in ujson.dump() on Write Failure. Affects ujson versions < 5.12.1. Fixed in 5.12.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

UltraJSON, also known as ujson, is a high-performance JSON encoder and decoder for Python. It is designed to be faster than the standard library's JSON module, making it a popular choice for applications that require efficient JSON serialization and deserialization. However, a recent vulnerability has been identified in the ujson.dump() function, which can lead to memory leaks under certain conditions.

Vulnerability Detail

The vulnerability arises when the ujson.dump() function attempts to write serialized JSON data to a file-like object. If the write operation fails and raises an exception, the memory allocated for the serialized JSON string is not properly released, leading to a memory leak. This issue can cause applications to consume increasing amounts of memory, potentially resulting in denial of service as the application may exhaust available memory resources. The root cause is located in the objToJSONFile() function, where an early return on write failure does not decrement the reference count of the allocated string object.

How To Fix

Latest published version: 6.0.0 as of 23 Oct 2026

pip install --upgrade "ujson==6.0.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.12.1

This is the first release that contains the fix.

pip install --upgrade "ujson==5.12.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can replace the use of ujson.dump() with ujson.dumps() followed by a direct write to the file. Here is an example code snippet:

import ujson

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

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

try:
    with open('output.json', 'w') as f:
        f.write(ujson.dumps(obj))
except RuntimeError:
    pass

Conclusion

The identified vulnerability in UltraJSON (CVE-2026-44660) poses a significant risk due to memory leaks caused by failed write operations in the ujson.dump() function. It is crucial for developers using this library to upgrade to the patched version or implement the suggested workaround to mitigate the risk of memory exhaustion.

See every vulnerability recorded for ujson →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 8.7, indicating a high severity level.

Versions of UltraJSON up to and including 5.12.0 are affected by this vulnerability.

You can use Vulert to monitor and alert in real-time for open-source vulnerabilities in your software. You can check if your application is affected by this vulnerability using the Vulert playground at Vulert Scanner.

If you cannot upgrade immediately, consider using the provided workaround to avoid the memory leak issue.

Yes, this vulnerability specifically affects Python applications that use the UltraJSON library for JSON serialization.

Related vulnerabilities

Recent vulnerabilities recorded for ujson.

How To Fix

Latest published version: 6.0.0 as of 23 Oct 2026

pip install --upgrade "ujson==6.0.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.12.1

This is the first release that contains the fix.

pip install --upgrade "ujson==5.12.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback