CVE-2022-31116Incorrect handling of invalid surrogate pair characters in ujson
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.
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
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.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | pandas | Fix pending | UBUNTU-CVE-2022-31116 | |
| Ubuntu 26.04 | pandas | Under investigation | UBUNTU-CVE-2022-31116 | |
| Ubuntu 26.04 | ujson | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | pandas | Will 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.10 | ujson | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | pandas | Under investigation | UBUNTU-CVE-2022-31116 | |
| Ubuntu 22.04 | collada2gltf | Under investigation | UBUNTU-CVE-2022-31116 | |
| Ubuntu 22.04 | pandas | Under investigation | UBUNTU-CVE-2022-31116 | |
| Ubuntu 22.04 | ujson | Fix pending | 5.1.0-1ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2022-31116 |
| Ubuntu 20.04 | pandas | Will 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.04 | collada2gltf | Will 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.04 | pandas | Will 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.04 | ujson | Fix pending | 1.35-2ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2022-31116 |
| Ubuntu 16.04 | collada2gltf | Will 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.04 | pandas | Will 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.04 | ujson | Will 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.04 | pandas | Will 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 14 | ujson | Fixed | 5.4.0-1 | DEBIAN-CVE-2022-31116 |
| Debian 13 | ujson | Fixed | 5.4.0-1 | DEBIAN-CVE-2022-31116 |
| Debian 12 | ujson | Fixed | 5.4.0-1 | DEBIAN-CVE-2022-31116 |
| Alpine Linux 3.24 | py3-ujson | Fixed | 5.4.0-r0 | ALPINE-CVE-2022-31116 |
| Alpine Linux 3.23 | py3-ujson | Fixed | 5.4.0-r0 | ALPINE-CVE-2022-31116 |
| Alpine Linux 3.22 | py3-ujson | Fixed | 5.4.0-r0 | ALPINE-CVE-2022-31116 |
| Alpine Linux 3.21 | py3-ujson | Fixed | 5.4.0-r0 | ALPINE-CVE-2022-31116 |
| Alpine Linux 3.20 | py3-ujson | Fixed | 5.4.0-r0 | ALPINE-CVE-2022-31116 |
| Alpine Linux 3.19 | py3-ujson | Fixed | 5.4.0-r0 | ALPINE-CVE-2022-31116 |
| Alpine Linux 3.18 | py3-ujson | Fixed | 5.4.0-r0 | ALPINE-CVE-2022-31116 |
| Alpine Linux 3.17 | py3-ujson | Fixed | 5.4.0-r0 | ALPINE-CVE-2022-31116 |
| Alpine Linux 3.16 | py3-ujson | Fixed | 5.4.0-r0 | ALPINE-CVE-2022-31116 |
| PyPI library | ujson | Fixed | 5.4.0 | PYSEC-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.
- ultrajson: affected: < 5.4.0
Vendor advisories:
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
References
- https://github.com/ultrajson/ultrajson/security/advisories/GHSA-wpqr-jcpx-745r
- https://github.com/ultrajson/ultrajson/commit/67ec07183342589d602e0fcf7bb1ff3e19272687
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2/
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.