CVE-2026-32875: ujson Integer Overflow Leading to Denial of Service
Summary
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 ↓
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.
No signup required · Results in about 60 seconds
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 →
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.
References
Related vulnerabilities
Recent vulnerabilities recorded for ujson.