Vulnerability · Published Jul 5, 2022 · Assigned by GitHub_M
CVE-2022-31117Double free of buffer during string decoding in ujson
Medium 5.9
In plain English
A medium-severity double free in ultrajson from ultrajson. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.9% (higher than 80% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | py3-ujson | 5.4.0-r0 | ALPINE-CVE-2022-31117 |
| Alpine:v3.21 | py3-ujson | 5.4.0-r0 | ALPINE-CVE-2022-31117 |
| Alpine:v3.22 | py3-ujson | 5.4.0-r0 | ALPINE-CVE-2022-31117 |
| Alpine:v3.23 | py3-ujson | 5.4.0-r0 | ALPINE-CVE-2022-31117 |
| Alpine:v3.24 | py3-ujson | 5.4.0-r0 | ALPINE-CVE-2022-31117 |
| Debian:12 | ujson | 5.4.0-1 | DEBIAN-CVE-2022-31117 |
| Debian:13 | ujson | 5.4.0-1 | DEBIAN-CVE-2022-31117 |
| Debian:14 | ujson | 5.4.0-1 | DEBIAN-CVE-2022-31117 |
| PyPI | ujson | 5.4.0 | PYSEC-2026-1056 |
| PyPI | ujson | 5.4.0 | GHSA-fm67-cv37-96ff |
| Ubuntu:22.04:LTS | collada2gltf | no fix listed | UBUNTU-CVE-2022-31117 |
| Ubuntu:22.04:LTS | pandas | no fix listed | UBUNTU-CVE-2022-31117 |
| Ubuntu:24.04:LTS | pandas | no fix listed | UBUNTU-CVE-2022-31117 |
| Ubuntu:25.10 | pandas | no fix listed | UBUNTU-CVE-2022-31117 |
| Ubuntu:26.04:LTS | pandas | no fix listed | UBUNTU-CVE-2022-31117 |
| Ubuntu:26.10 | pandas | no fix listed | UBUNTU-CVE-2022-31117 |
Affected products (as reported)
Weakness: CWE-415 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- https://github.com/ultrajson/ultrajson/security/advisories/GHSA-fm67-cv37-96ff x_refsource_CONFIRM
- https://github.com/ultrajson/ultrajson/commit/9c20de0f77b391093967e25d01fb48671104b15b x_refsource_MISC
- FEDORA-2022-1b2b8d5177 vendor-advisory, x_refsource_FEDORA
- FEDORA-2022-33e816bc37 vendor-advisory, x_refsource_FEDORA