Vulnerabilities in pkg:pypi/ujson
PACKAGECVE-2026-54911 is a MODERATE (CVSS 6.5) malformed/truncated utf-8 accepted and silently vulnerability (CWE-20: Improper Input Validation) affecting UltraJSON libraries in the PyPI ecosystem. The issue involves malformed/truncated utf-8 accepted and silently rewritten in ujson.dumps(). Remediation is available by upgrading affected packages to version 5.13.0.
pkg:pypi/ujson
Vulnerability advisories affecting package pkg:pypi/ujson. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-3j69-69wj-xqx2 | CVE-2026-54911 | MODERATE | UltraJSON: Malformed/Truncated UTF-8 Accepted and Silently Rewritten in ujson.dumps() |
| GHSA-c38f-wx89-p2xg | CVE-2026-44660 | HIGH | UltraJSON has a Memory Leak in ujson.dump() on Write Failure |
| GHSA-c8rr-9gxc-jprv | CVE-2026-32875 | HIGH | UltraJSON has an integer overflow handling large indent leads to buffer overflow or infinite loop |
| GHSA-wgvc-ghv9-3pmm | CVE-2026-32874 | HIGH | UltraJSON has a Memory Leak parsing large integers allows DoS |
| GHSA-fh56-85cw-5pq6 | CVE-2021-45958 | MODERATE | UltraJSON vulnerable to Out-of-bounds Write |
| GHSA-wpqr-jcpx-745r | CVE-2022-31116 | HIGH | Incorrect handling of invalid surrogate pair characters |
| GHSA-fm67-cv37-96ff | CVE-2022-31117 | MODERATE | Potential double free of buffer during string decoding |
CVE-2026-54911 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N).
How to Fix CVE-2026-54911
To remediate this vulnerability, upgrade all affected UltraJSON dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install ujson>=5.13.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show ujson
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-54911, inspect your installed packages using pip:
pip show ujson
Analyze the terminal output to locate any version of UltraJSON in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.13.0), your application is affected.
Note: The pip show ujson command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In UltraJSON, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-54911 Affected UltraJSON Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ujson
|
PyPI |
< 5.13.0
|
5.13.0
|
References
Frequently Asked Questions
What is CVE-2026-54911?
Which UltraJSON versions are affected?
What version fixes CVE-2026-54911?
Is ujson affected?
What is the CVSS score of CVE-2026-54911?
What CWE is associated with CVE-2026-54911?
How can I check PyPI dependencies for CVE-2026-54911?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-3j69-69wj-xqx2",
"modified" : "2026-07-18T17:28:55Z",
"published" : "2026-06-19T20:47:43Z",
"aliases" : [ "CVE-2026-54911" ],
"summary" : "UltraJSON: Malformed/Truncated UTF-8 Accepted and Silently Rewritten in ujson.dumps()",
"details" : "### Summary\n`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.\n\n### Details\n\nThe 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:\n\n* Invalid continuation bytes are replaced with valid ones: `b'\\xcf\\x13'` -> `b'\\xcf\\x93'`\n* Unterminated sequence completes the sequence: `b'\\xc3'` -> `b'\\xc3\\x80'`\n* ... or leads to reading past the end of string: `b'\\xf0\\x90\\x94'` -> `b\"\\xf0\\x90\\x94\\x80inxcontrib'\"`\n\n### Impact\n\nAn application relying on reject_bytes=False for UTF-8 handling may experience:\n\n- Data integrity issues\n- Experience validation bypass if said validation occurs before serialisation\n\n### Remediation\n\nThe 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](https://github.com/ultrajson/ultrajson/releases/tag/5.13.0).\n\n### Workarounds\n\nDecoding bytes to strings in Python before passing them to `ujson.dumps()` avoids this issue.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "ujson"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.13.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 5.12.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ultrajson/ultrajson/security/advisories/GHSA-3j69-69wj-xqx2"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-54911"
}, {
"type" : "WEB",
"url" : "https://github.com/ultrajson/ultrajson/commit/169eaf36b1116fece5034ee79a7a0ef3f6deedcf"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/ujson/PYSEC-2026-2294.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ultrajson/ultrajson"
}, {
"type" : "WEB",
"url" : "https://github.com/ultrajson/ultrajson/releases/tag/5.13.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-19T20:47:43Z",
"nvd_published_at" : "2026-06-22T22:16:50Z"
}
}