CVE-2022-31117 json
Double free of buffer during string decoding in ujson
published 2022-07-05 4 y ago modified 2026-07-07 4 mo ago also GHSA-fm67-cv37-96ff , PYSEC-2026-1056 , EUVD-2022-6334
- cvss
- 5.9
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.9%
- EPSS 1.9% chance of exploitation in 30 days, percentile 79%
- public exploits
- 0
- none known
Summary
UltraJSON is a fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. In versions prior to 5.4.0 an error occurring while reallocating a buffer for string decoding can cause the buffer to get freed twice. Due to how UltraJSON uses the internal decoder, this double free is impossible to trigger from Python. This issue has been resolved in version 5.4.0 and all users should upgrade to UltraJSON 5.4.0. There are no known workarounds for this issue.
Patch / fix
- pypi ujson 5.4.0
- ultrajson_project ultrajson 5.4.0
- ujson Debian 14, Debian 13, Debian 12 5.4.0-1
debian advisories DEBIAN-CVE-2022-31117
- ujson Ubuntu Pro 16.04 LTS 1.33-1ubuntu0.1~esm2
- ujson Ubuntu Pro 18.04 LTS 1.35-2ubuntu0.1~esm1
- ujson Ubuntu Pro 22.04 LTS 5.1.0-1ubuntu0.1~esm1
ubuntu advisories UBUNTU-CVE-2022-31117
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- python-ujson openstack 16.2, openstack 16.1 2.0.3-3.el8ost
- python3-ujson openstack 16.2, openstack 16.1 2.0.3-3.el8ost
red hat advisories RHSA-2022:8864RHSA-2022:8850
- python-ujson SLE Module for Package Hub 15 SP4, SLE Module for Package Hub 15 SP3, SLE Module for Development Tools 15 SP4 +3 more 1.35-150100.3.5.1
suse advisories SUSE-SU-2022:2673-1
- python-ujson openSUSE Tumbleweed 5.10.0-1.5
opensuse advisories openSUSE-SU-2025:15107-1
- py3-ujson Alpine 3.24, Alpine 3.23, Alpine 3.22 +6 more 5.4.0-r0
alpine advisories ALPINE-CVE-2022-31117
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-31117 updated cvss 5.9
python-ujson: Potential double free of buffer during string decoding
-
Red Hat OpenStack Platform 13 (Queens) python-ujsonaffected: no fix planned “Out of support scope”
-
Red Hat OpenStack Platform 16.1 python-ujson 2.0.3-3.el8ost, python3-ujson 2.0.3-3.el8ostfixed: vendor fix RHSA-2022:8864
-
Red Hat OpenStack Platform 16.2 python-ujson 2.0.3-3.el8ost, python3-ujson 2.0.3-3.el8ostfixed: vendor fix RHSA-2022:8850
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 18 mo ago
Exploit prediction
1.88% chance of exploitation in the next 30 days, higher than 79% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 5.9 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 3.1 | 5.9 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 2.0 | 4.3 | AV:N/AC:M/Au:N/C:N/I:N/A:P |
| GitHub | 3.1 | 5.9 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| OSV | 3.1 | 5.9 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | ujson | <5.4.0 |
5.4.0 |
Affected products
- ultrajson ultrajson
Classification
- Weakness
-
- CWE-415 Double Free
References
-
github.com
/ultrajson/ultrajson/commit/9c20de0f77b391093967e25d01fb48671104b15b
web, patch, third-party-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2/
vendor-advisory
-
github.com
/ultrajson/ultrajson/security/advisories/GHSA-fm67-cv37-96ff
web, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2022-31117
advisory
-
github.com
/ultrajson/ultrajson
package
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7
web
-
pypi.org
/project/ujson
package
-
github.com
/advisories/GHSA-fm67-cv37-96ff
advisory
Sources
- CVE List CVE-2022-31117
- GitHub Advisory GHSA-fm67-cv37-96ff
- NVD CVE-2022-31117
- OSV PYSEC-2026-1056
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.