CVE-2026-32875 is a high-severity (CVSS 7.5) CWE-190 vulnerability in ujson. A fix is available for ujson — see the affected versions and patch details below.
UltraJSON has an integer overflow handling large indent leads to buffer overflow or infinite loop
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-32875.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
ujsonReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Summary
ujson.dumps() crashes the Python interpreter (segmentation fault) when the product of the indent parameter and the nested depth of the input exceeds INT32_MAX. It can also get stuck in an infinite loop if the indent is a large negative number. Both are caused by an integer overflow/underflow whilst calculating how much memory to reserve for indentation. And both can be used to achieve denial of service.
(Note: A negative indent to ujson means add spaces after colons but do not add line breaks or indentation. It is unclear to the current maintainers whether this was ever even an intended feature or just a byproduct of the way it was written.)
Exploitability
To be vulnerable, a service must call ujson.dump()/ujson.dumps()/ujson.encode() whilst giving untrusted users control over the indent parameter and not restrict that indentation to reasonably small non-negative values. (Even with the fix for this vulnerability, such usage is strongly advised against since even a bug-free JSON serialiser would be vulnerable to denial of service simply by the attacker requesting indents that have the server needlessly filling out gigabytes of whitespace.)
A service may also be vulnerable to the infinite loop if it uses a fixed negative indent. An underflow always occurs for any negative indent when the input data is at least one level nested but, for small negative indents, the underflow is usually accidentally rectified by another overflow. As far as the maintainers are aware, the infinite loop can not be reached for indentations from -1 to -65536 / max_recursion_depth_as_limited_by_stack_size but users of negative indents are encouraged to consider their service affected even if the infinite loop seems unreachable.
Example
import ujson
def example(depth, indent):
a = [0]
for i in range(1000):
a = [a]
ujson.dumps(a, indent=indent)
example(1, 2**30) # segfault
example(1000, -200) # infinite loop
Patches
ujson 5.12.0, containing 486bd4553dc471a1de11613bc7347a6b318e37ea, promotes the integer types where the overflow occurred, skips the indentation code path for negative indent (which was supposed to be a no-op) and places an artificial cap of 1000 on the indent parameter.
Workarounds
Users who don't wish to upgrade can either use a fixed indentation, no indentation or ensure indentation is non-negative and not enormous (below 2**31 / max_recursion_depth_as_limited_by_stack_size).
References
The original bug report can be found at https://github.com/ultrajson/ultrajson/issues/700
This issue was independently discovered by @coco1629, @EthanKim88 and @vmfunc.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | ujson | ≥ 5.1.0&&< 5.12.0 | 5.12.0pip install --upgrade 'ujson==5.12.0' |
Affected Products
ultrajsonultrajson_projectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for ujson, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update ujson to 5.12.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-32875 is resolved across your whole dependency graph.
Workarounds
Stop feeding it untrusted input: reject or quarantine files and payloads from unverified sources until you can upgrade, restrict accepted formats to the ones you actually need, and run the parsing or decoding step in a least-privileged sandbox or short-lived worker so a crash or corrupted read cannot reach the rest of the process.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This is an IMPORTANT denial of service flaw in UltraJSON, affecting Red Hat products that utilize `python-ujson`, including various Community Projects and Red Hat OpenStack Platform. The vulnerability arises when applications process untrusted input that controls the `indent` parameter in JSON serialization functions,…
To mitigate this issue, applications utilizing `python-ujson` should ensure that the `indent` parameter in `ujson.dump()`, `ujson.dumps()`, or `ujson.encode()` functions is not controlled by untrusted input. If untrusted input must influence indentation, restrict the `indent` value to reasonably small, non-negative integers. Review application code to identify and validate all uses of the `indent` parameter with external data.Source: Red Hat security advisory for CVE-2026-32875 (CC BY 4.0)
Frequently Asked Questions
Is CVE-2026-32875 in your dependencies?
Find it across PyPI, including transitive dependencies.