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
Share

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
qualitative
Red Hat
5.3 MEDIUM
qualitative

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

Lifecycle Timeline

2
Source Code Evidence Fetched
Jun 19, 2026 - 21:54 vuln.today
Analysis Generated
Jun 19, 2026 - 21:54 vuln.today

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 435 pypi packages depend on ujson (193 direct, 245 indirect)

Ecosystem-wide dependent count for version 5.13.0.

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.

AnalysisAI

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.

Technical ContextAI

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.

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.

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

Share

CVE-2026-54911 vulnerability details – vuln.today

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