Vulnerability · Published Jul 5, 2022 · Assigned by GitHub_M

CVE-2022-31116Incorrect handling of invalid surrogate pair characters in ujson

High 7.5

In plain English

A high-severity security flaw in ultrajson from ultrajson. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 2.5% (higher than 85% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.5High
Exploit odds (30 days)2.5%top 14.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official description

UltraJSON is a fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. Affected versions were found to improperly decode certain characters. JSON strings that contain escaped surrogate characters not part of a proper surrogate pair were decoded incorrectly. Besides corrupting strings, this allowed for potential key confusion and value overwriting in dictionaries. All users parsing JSON from untrusted sources are vulnerable. From version 5.4.0, UltraJSON decodes lone surrogates in the same way as the standard library's `json` module does, preserving them in the parsed output. Users are advised to upgrade. There are no known workarounds for this issue.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.20py3-ujson5.4.0-r0ALPINE-CVE-2022-31116
Alpine:v3.21py3-ujson5.4.0-r0ALPINE-CVE-2022-31116
Alpine:v3.22py3-ujson5.4.0-r0ALPINE-CVE-2022-31116
Alpine:v3.23py3-ujson5.4.0-r0ALPINE-CVE-2022-31116
Alpine:v3.24py3-ujson5.4.0-r0ALPINE-CVE-2022-31116
Debian:12ujson5.4.0-1DEBIAN-CVE-2022-31116
Debian:13ujson5.4.0-1DEBIAN-CVE-2022-31116
Debian:14ujson5.4.0-1DEBIAN-CVE-2022-31116
PyPIujson5.4.0PYSEC-2026-1057
PyPIujson5.4.0GHSA-wpqr-jcpx-745r
Ubuntu:22.04:LTScollada2gltfno fix listedUBUNTU-CVE-2022-31116
Ubuntu:22.04:LTSpandasno fix listedUBUNTU-CVE-2022-31116
Ubuntu:24.04:LTSpandasno fix listedUBUNTU-CVE-2022-31116
Ubuntu:25.10pandasno fix listedUBUNTU-CVE-2022-31116
Ubuntu:26.04:LTSpandasno fix listedUBUNTU-CVE-2022-31116
Ubuntu:26.10pandasno fix listedUBUNTU-CVE-2022-31116

Affected products (as reported)

VendorProductVersions
ultrajson ultrajson < 5.4.0

Weakness: CWE-670 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References