Skip to main content

UltraJSON CVE-2026-54911

MEDIUM
Improper Input Validation (CWE-20)
2026-06-19 https://github.com/ultrajson/ultrajson GHSA-3j69-69wj-xqx2
6.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
    Submit crafted malformed UTF-8 bytes in request
  2. Delivery
    Application validates raw bytes (blocklist/allowlist passes)
  3. Exploit
    ujson.dumps(reject_bytes=False) silently rewrites bytes to different Unicode
  4. Execution
    Rewritten data bypasses downstream validation
  5. Impact
    Corrupted or policy-violating content stored or forwarded

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
Exploitation Conditions

Exploitation requires that the target application explicitly passes the reject_bytes=False keyword argument to ujson.dumps(), ujson.dump(), or ujson.encode() - this is an opt-in parameter, not the default behavior. Additionally, the meaningful security impact (validation bypass) only materializes when the application performs input validation on the raw bytes BEFORE passing them to ujson for serialization; if validation occurs on the serialized output or the deserialized result, the bypass does not apply. The attacker must be able to supply arbitrary byte sequences as input to the serialization path. The CVSS vector PR:N indicates no authentication is required from the attacker's side to submit the input, but the application must be network-accessible and must exhibit the two-condition configuration above. Exploitation is limited by: (1) the non-default opt-in configuration requirement, (2) the pre-serialization validation ordering requirement, and (3) the absence of any availability or direct remote-code-execution impact - the flaw alters data content rather than granting code execution.

Impact

The NVD-assigned CVSS 3.1 vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N yields a score of 6.5 (Medium), treating this as a low-complexity unauthenticated network-reachable flaw. That characterization is partially misleading: the vulnerability only triggers when two non-trivial conditions align - the application must explicitly pass reject_bytes=False (a non-default opt-in), AND it must perform input validation on bytes before calling ujson.dumps() rather than after. Both conditions must hold simultaneously for a meaningful attack. This suggests AC:H is more appropriate than AC:L for an independent assessment, materially reducing practical risk. There is no CISA KEV listing and no public exploit or POC identified at time of analysis. No EPSS score was provided in the source data. The most credible real-world risk is in data-processing pipelines or APIs that accept raw byte payloads from untrusted sources, decode them lazily via ujson, and enforce allow-list or pattern-matching validation on the pre-serialization bytes - a pattern seen in some binary protocol gateways and multipart upload handlers. The out-of-bounds read variant (b'\xf0\x90\x94' reading adjacent memory) theoretically carries a minor information disclosure risk, but the practical exploitability of leaking meaningful memory content this way is low and unconfirmed.

Exploit ScenarioDerived

An attacker submits a crafted multipart or binary HTTP request body containing the byte sequence b'\xcf\x13' to a Python web application that uses ujson.dumps(body, reject_bytes=False) to re-serialize the payload for downstream storage or forwarding. The application's input filter checks the raw bytes against a blocklist before calling ujson - b'\xcf\x13' passes the check. After ujson silently rewrites it to b'\xcf\x93' (a different Unicode character), the downstream system receives and processes data that was never validated, potentially bypassing a content-moderation, injection-detection, or protocol-conformance rule. No public exploit code exists at time of analysis.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Jun 19, 2026

Silent UTF-8 rewriting in UltraJSON (ujson) versions up to and including 5.12.1 allows input validation bypass and data integrity corruption when the reject_bytes=False encoding option is used. Malformed or truncated byte sequences - including invalid continuation bytes and over-read sequences - are silently transformed into different, syntactically valid Unicode characters rather than triggering an error, meaning data that exits ujson.dumps() differs from data that entered it. This creates a validation bypass window for any application that validates raw bytes before serialization, and no public exploit has been identified at time of analysis, though the flaw is fully described with reproducible examples in the GHSA advisory.

RemediationAI

Upgrade UltraJSON to version 5.13.0 or later, which contains the fix committed at https://github.com/ultrajson/ultrajson/commit/169eaf36b1116fece5034ee79a7a0ef3f6deedcf. The 5.13.0 release is confirmed by the upstream advisory at https://github.com/ultrajson/ultrajson/releases/tag/5.13.0. If an immediate upgrade is not feasible, the vendor-documented workaround is to decode bytes to Python str objects before passing them to ujson.dumps() - for example, replace ujson.dumps(b_value, reject_bytes=False) with ujson.dumps(b_value.decode('utf-8', errors='surrogatepass')). This causes Python's own UTF-8 codec to perform validation and raise a UnicodeDecodeError on malformed input before ujson is ever invoked. The trade-off is that this approach changes error handling semantics (Python raises on strict invalid sequences that surrogatepass may handle differently) and adds a Python-layer decode step that reduces the performance advantage of using ujson. A second compensating control, applicable where performance is critical, is to restrict which callers are permitted to pass reject_bytes=False and audit all such call sites to ensure no pre-serialization validation logic relies on byte identity.

Affected Packages

pypi ujson fix: 5.13.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

UltraJSON is a high-performance C-extension JSON library for Python (pip/ujson). The vulnerability resides in the C-level encoder Buffer_EscapeStringValidated() in src/ujson/lib/ultrajsonenc.c. When reject_bytes=False is passed to ujson.dumps(), ujson.dump(), or ujson.encode(), the encoder was not performing adequate bounds checks or continuation-byte validation before processing multi-byte UTF-8 sequences. Specifically: 2-byte sequences did not verify the second byte matched the 0b10xxxxxx mask; 3-byte and 4-byte sequences similarly skipped continuation validation; and truncated sequences could cause reads past the end of the input buffer, pulling in adjacent memory contents (e.g., b'\xf0\x90\x94' consumed bytes from the string 'inxcontrib' that followed in memory). The root cause is CWE-20 (Improper Input Validation) - the library trusted that byte sequences arriving at the encoder were well-formed rather than enforcing the UTF-8 grammar. The fix in commit 169eaf36b1116fece5034ee79a7a0ef3f6deedcf adds explicit checks for each continuation byte (io[n] & 0xc0 != 0x80), bounds checks that require the full sequence length to be available before reading, and rejection of codepoints above U+10FFFF.

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 6.5 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
vuln.today AI 4.8 MEDIUM

AC:H because exploitation requires both non-default reject_bytes=False configuration and pre-serialization validation ordering; no confidentiality or availability impact beyond data integrity mutation.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
SUSE MEDIUM
Red Hat 5.3 MEDIUM

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
Low
Integrity
Low
Availability
None

DescriptionCVE.org

Summary

ujson.dumps() (or ujson.dump() or ujson.encode()) have a reject_bytes=False option. When set, they may accept malformed or truncated UTF-8 byte sequences, silently rewriting them into different Unicode characters instead of rejecting them. This leads to input validation bypass and data integrity issues.

Details

The expected behavior is that for x being any bytes string, x == ujson.loads(ujson.dumps(x, reject_bytes=False)).encode(errors="surrogatepass") should always either be true or ujson.dumps() will throw an exception. In reality, some strings which should've been errors are silently rewritten as other strings:

  • Invalid continuation bytes are replaced with valid ones: b'\xcf\x13' -> b'\xcf\x93'
  • Unterminated sequence completes the sequence: b'\xc3' -> b'\xc3\x80'
  • ... or leads to reading past the end of string: b'\xf0\x90\x94' -> b"\xf0\x90\x94\x80inxcontrib'"

Impact

An application relying on reject_bytes=False for UTF-8 handling may experience:

  • Data integrity issues
  • Experience validation bypass if said validation occurs before serialisation

Remediation

The missing/broken UTF-8 validation checks were added/fixed in https://github.com/ultrajson/ultrajson/commit/169eaf36b1116fece5034ee79a7a0ef3f6deedcf. We recommend upgrading to UltraJSON 5.13.0.

Workarounds

Decoding bytes to strings in Python before passing them to ujson.dumps() avoids this issue.

Threat Intelligence Overview

EPSS Score
0.3%
Top 80% exploitable
Threat Intel
1
1 sources
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA 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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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
None
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

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

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

Affected Products (CPE)CVE.org

pkg:pip/ujson

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

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Affected
SUSE Linux Enterprise Module for Development Tools 15 SP7 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP7 Affected
SUSE Linux Enterprise Server 15 SP7 Affected

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