CVEfocus › CVE database › CVE-2022-31116

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

CVSS 7.5 HighEPSS 2.0% (higher than 81% of CVEs)Published 2022-07-05Updated 2025-04-22Assigner: GitHub_M

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.

CWE-670

What to do

Fixed builds are available from Alpine, Debian, PyPI: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

13Fixed
3Fix pending
4Under investigation
8Will not fix
2Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10pandasFix pendingUBUNTU-CVE-2022-31116
Ubuntu 26.04pandasUnder investigationUBUNTU-CVE-2022-31116
Ubuntu 26.04ujsonNot affected
vulnerable_code_not_present
Ubuntu 25.10pandasWill not fix
the embedded ujson code in pandas, eventhough containing similar content as the upstream ujson code, seems to have diverged from the ujson upstream project…
UBUNTU-CVE-2022-31116
Ubuntu 25.10ujsonNot affected
vulnerable_code_not_present
Ubuntu 24.04pandasUnder investigationUBUNTU-CVE-2022-31116
Ubuntu 22.04collada2gltfUnder investigationUBUNTU-CVE-2022-31116
Ubuntu 22.04pandasUnder investigationUBUNTU-CVE-2022-31116
Ubuntu 22.04ujsonFix pending5.1.0-1ubuntu0.1~esm1 (Ubuntu Pro)UBUNTU-CVE-2022-31116
Ubuntu 20.04pandasWill not fix
the embedded ujson code in pandas, eventhough containing similar content as the upstream ujson code, seems to have diverged from the ujson upstream project…
UBUNTU-CVE-2022-31116
Ubuntu 18.04collada2gltfWill not fix
the embedded ujson code in pandas, eventhough containing similar content as the upstream ujson code, seems to have diverged from the ujson upstream project…
UBUNTU-CVE-2022-31116
Ubuntu 18.04pandasWill not fix
the embedded ujson code in pandas, eventhough containing similar content as the upstream ujson code, seems to have diverged from the ujson upstream project…
UBUNTU-CVE-2022-31116
Ubuntu 18.04ujsonFix pending1.35-2ubuntu0.1~esm1 (Ubuntu Pro)UBUNTU-CVE-2022-31116
Ubuntu 16.04collada2gltfWill not fix
the embedded ujson code in pandas, eventhough containing similar content as the upstream ujson code, seems to have diverged from the ujson upstream project…
UBUNTU-CVE-2022-31116
Ubuntu 16.04pandasWill not fix
the embedded ujson code in pandas, eventhough containing similar content as the upstream ujson code, seems to have diverged from the ujson upstream project…
UBUNTU-CVE-2022-31116
Ubuntu 16.04ujsonWill not fix
the embedded ujson code in pandas, eventhough containing similar content as the upstream ujson code, seems to have diverged from the ujson upstream project…
1.33-1ubuntu0.1~esm2 (Ubuntu Pro)UBUNTU-CVE-2022-31116
Ubuntu 14.04pandasWill not fix
the embedded ujson code in pandas, eventhough containing similar content as the upstream ujson code, seems to have diverged from the ujson upstream project…
UBUNTU-CVE-2022-31116
Debian 14ujsonFixed5.4.0-1DEBIAN-CVE-2022-31116
Debian 13ujsonFixed5.4.0-1DEBIAN-CVE-2022-31116
Debian 12ujsonFixed5.4.0-1DEBIAN-CVE-2022-31116
Alpine Linux 3.24py3-ujsonFixed5.4.0-r0ALPINE-CVE-2022-31116
Alpine Linux 3.23py3-ujsonFixed5.4.0-r0ALPINE-CVE-2022-31116
Alpine Linux 3.22py3-ujsonFixed5.4.0-r0ALPINE-CVE-2022-31116
Alpine Linux 3.21py3-ujsonFixed5.4.0-r0ALPINE-CVE-2022-31116
Alpine Linux 3.20py3-ujsonFixed5.4.0-r0ALPINE-CVE-2022-31116
Alpine Linux 3.19py3-ujsonFixed5.4.0-r0ALPINE-CVE-2022-31116
Alpine Linux 3.18py3-ujsonFixed5.4.0-r0ALPINE-CVE-2022-31116
Alpine Linux 3.17py3-ujsonFixed5.4.0-r0ALPINE-CVE-2022-31116
Alpine Linux 3.16py3-ujsonFixed5.4.0-r0ALPINE-CVE-2022-31116
PyPI libraryujsonFixed5.4.0PYSEC-2026-1057

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.