CVE-2026-32875: ujson Integer Overflow Leading to Denial of Service

ujson Updated 18 Mar 2026

Summary

18/03/2026
Yes i
High
7.5

CVE-2026-32875: UltraJSON has an integer overflow handling large indent leads to buffer overflow or infinite loop. Affects ujson versions >= 5.1.0, < 5.12.0. Fixed in 5.12.0. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

UltraJSON, commonly known as ujson, is a high-performance JSON encoder and decoder for Python. It is designed to provide faster serialization and deserialization of JSON data compared to the standard library's json module. However, due to its handling of the 'indent' parameter, ujson is susceptible to an integer overflow vulnerability that can lead to severe issues, including crashes and infinite loops.

Vulnerability Detail

The vulnerability arises when the 'indent' parameter in ujson's dumps function is manipulated. If the product of the 'indent' value and the nested depth of the input exceeds INT32_MAX, it can cause the Python interpreter to crash due to a segmentation fault. Additionally, if a large negative number is provided as the indent, it can lead to an infinite loop. This vulnerability can be exploited to achieve denial of service, making it critical for services that rely on ujson to handle untrusted input.

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

This is the first release that contains the fix.

pip install --upgrade "ujson==5.12.0"

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

Workaround

If upgrading is not feasible, consider using a fixed indentation value, avoiding negative indents, or ensuring that the indent is non-negative and below 2**31. Here is an example code snippet to demonstrate safe usage:

import ujson

def safe_example(depth, indent):
    if indent < 0 or indent > 1000:
        raise ValueError('Indent must be non-negative and not exceed 1000.')
    a = [0]
    for i in range(depth):
        a = [a]
    return ujson.dumps(a, indent=indent)

# Usage
safe_example(1000, 2)  # Safe usage

Conclusion

The integer overflow vulnerability in ujson can lead to significant issues, including application crashes and denial of service. It is crucial to update to the patched version or implement workarounds to mitigate the risk. Regular monitoring for vulnerabilities using tools like Vulert can help maintain application security.

See every vulnerability recorded for ujson →

Share this vulnerability

FAQ

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

ujson versions prior to 5.12.0 are affected by this vulnerability.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If upgrading is not an option, ensure that the indent parameter is non-negative and below 1000, or use fixed indentation values.

Exploiting this vulnerability can lead to denial of service, causing the application to crash or hang indefinitely.

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

This is the first release that contains the fix.

pip install --upgrade "ujson==5.12.0"

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