Skip to main content

Python CVE-2026-32875

HIGH
Integer Overflow or Wraparound (CWE-190)
2026-03-18 https://github.com/ultrajson/ultrajson GHSA-c8rr-9gxc-jprv
7.5
CVSS 3.1 · Vendor: https://github.com/ultrajson/ultrajson
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Send ujson.dumps() with large indent parameter
  2. Exploit
    Calculate nested depth exceeding INT32_MAX
  3. Execution
    Integer overflow in memory allocation
  4. Impact
    Trigger 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

pypi ujson fix: 5.12.0

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

Vendor (https://github.com/ultrajson/ultrajson) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Red Hat 7.5 HIGH

Primary rating from Vendor (https://github.com/ultrajson/ultrajson).

CVSS VectorVendor: https://github.com/ultrajson/ultrajson

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

2
Patch released
Mar 18, 2026 - 13:15 nvd
Patch available
CVE Published
Mar 18, 2026 - 13:01 nvd
HIGH 7.5

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

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

Executive ViewAI

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.0%
Top 89% exploitable
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS Vendor GitHub VulDB

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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

pkg:pip/ujson

Related Vulnerabilities in ujson Memory and Integer Vulnerabilities

View all 2

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

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

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy