Impact
ujson.dumps(), ujson.dump(), and ujson.encode() can be configured with reject_bytes=False, which allows the function to accept invalid or truncated UTF‑8 byte sequences. When this occurs, the library silently rewrites the malformed bytes into different Unicode code points rather than rejecting them, bypassing the intended input validation. This behavior can corrupt data structures, produce unintended output, and undermine data integrity. The vulnerability is a classic input validation flaw (CWE‑20).
Affected Systems
The issue affects all installations of UltraJSON version 5.12.x and earlier. Any environment that imports and uses ujson.dumps() (or its variants) from these versions without the fix is vulnerable. The fix is contained in UltraJSON 5.13.0 and later.
Risk and Exploitability
The vulnerability has a CVSS score of 6.5, indicating moderate severity. EPSS data is unavailable, so the exploitation probability is unknown, and the flaw is not listed in CISA’s KEV catalog. The likely attack vector is from code that receives user‑controlled input and passes it directly to the vulnerable encoding functions; thus, a threat actor could influence the encoded output or inject data that is later misinterpreted. Exploitation would require ability to supply arbitrary UTF‑8 data to the application, making it a local or web‑app‑level risk rather than an arbitrary remote execution vector.
OpenCVE Enrichment
Github GHSA