Python
CVE-2026-32875
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend ujson.dumps() with large indent parameter
-
ExploitCalculate nested depth exceeding INT32_MAX
-
ExecutionInteger overflow in memory allocation
-
ImpactTrigger segmentation fault or infinite loop
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2021 - Vulnerable and Outdated Components
ASVS 5.0
V15 - Secure Coding and Architecture Integer overflow checks
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Remote unauthenticated attacker can trigger denial of service by calling ujson.dumps() with: (1) indent parameter whose product with input nesting depth exceeds INT32_MAX, or (2) large negative indent value. No special configuration required; affects default ujson library usage in Python applications processing untrusted JSON. |
| Impact | The CVSS v3.1 score of 7.5 (High) reflects the potential for network-based denial of service with low attack complexity and no required privileges or user interaction (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H). However, real-world exploitability is constrained by specific preconditions: the application must expose the indent parameter to untrusted input without validation, or use fixed large negative indent values. Most secure coding practices would not expose serialization formatting parameters to users, significantly limiting the attack surface. The availability of a proof-of-concept makes testing trivial for affected systems, but the narrow exploitation scenario suggests this is primarily a risk for misconfigured or poorly designed APIs rather than a widespread critical threat. The vulnerability is not present in CISA KEV, indicating no observed in-the-wild exploitation. Organizations should prioritize remediation based on whether their ujson usage patterns match the vulnerable configurations described, rather than treating this as a blanket critical issue. |
| Exploit ScenarioDerived | An attacker identifies a web API that uses ujson.dumps() and exposes the indent parameter through query strings or POST body parameters for formatted JSON responses. The attacker sends a request with indent set to 2^30 (1073741824) along with minimally nested JSON data, causing the server's Python interpreter to crash with a segmentation fault and requiring process restart. Alternatively, if the service uses a negative indent internally, the attacker crafts deeply nested JSON input (approximately 1000 levels deep) with an indent of -200, triggering an infinite loop that consumes CPU resources and hangs the worker process indefinitely. The proof-of-concept code provided in the disclosure makes exploitation straightforward for attackers who identify vulnerable endpoints. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Mar 18, 2026
The ujson Python library prior to version 5.12.0 contains an integer overflow/underflow vulnerability in the dumps() function that can crash the Python interpreter (segmentation fault) or cause an infinite loop, leading to denial of service. The vulnerability affects applications that allow untrusted users to control the indent parameter when serializing JSON, or that use large negative indent values with nested data structures. A proof-of-concept demonstrating both the segfault and infinite loop conditions is provided in the vulnerability disclosure, though there is no evidence of active exploitation (not in KEV).
RemediationAI
Upgrade ujson to version 5.12.0 or later, which contains the fix in commit 486bd4553dc471a1de11613bc7347a6b318e37ea available at https://github.com/ultrajson/ultrajson/commit/486bd4553dc471a1de11613bc7347a6b318e37ea. The patch promotes integer types to prevent overflow, skips indentation code for negative indent values, and enforces a hard cap of 1000 on the indent parameter. For systems unable to upgrade immediately, implement application-level controls to either use fixed indentation values, disable indentation entirely, or validate that any user-supplied indent parameter is non-negative and below 2^31 divided by the maximum recursion depth. As a general security practice, avoid exposing JSON serialization formatting parameters to untrusted users regardless of the library version, as even legitimate large indent values can cause resource exhaustion through excessive whitespace generation.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The ujson library (pkg:pip/ujson) is a fast JSON encoder and decoder written in C for Python. The vulnerability stems from CWE-190 (Integer Overflow or Wraparound) occurring during memory allocation calculations for indentation whitespace. When the product of the indent parameter and nested depth exceeds INT32_MAX, an integer overflow occurs while calculating buffer size. Additionally, negative indent values (which appear to be an undocumented or unintended feature that adds spaces after colons without line breaks) can trigger an integer underflow when combined with nested data structures, potentially causing an infinite loop. The C-level implementation fails to validate input bounds before performing arithmetic operations on integer types that are too small to hold the result.
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Primary rating from Vendor (https://github.com/ultrajson/ultrajson).
CVSS VectorVendor: https://github.com/ultrajson/ultrajson
Lifecycle Timeline
2DescriptionCVE.org
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 loopPatches
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.
Executive ViewAI
A high-severity vulnerability in the ujson Python library could allow attackers to crash applications or cause service outages through denial of service attacks. Any organization using ujson in production environments with user-controlled input should prioritize patching to prevent potential service disruptions and resource exhaustion.
Apply vendor patch. If immediate patching is not possible: (1) Implement input validation to restrict or sanitize the indent parameter passed to dumps() function; (2) Apply WAF rules to block requests with suspicious JSON serialization parameters; (3) Disable ujson library features that accept user-controlled indent parameters; (4) Use network segmentation to limit exposure of affected services to trusted networks only.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Affected Products (CPE)CVE.org
Related Vulnerabilities in ujson Memory and Integer Vulnerabilities
View all 2Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
GHSA-c8rr-9gxc-jprv
NVD
CVE.org
EPSS
VulDB
Exploit-DB