5.9medium
Double free of buffer during string decoding in ujson
- Severity
- 5.9medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.88% (higher than 80% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-fm67-cv37-96ffPYSEC-2026-1056
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
| Product or package | Versions | Reported by |
|---|---|---|
| ultrajson ultrajson | < 5.4.0 | CVE List |
| ujson (PyPI) | before 5.4.0 | GitHub Advisory Database, PyPA Advisory Database |
| ultrajson_project ultrajson | before 5.4.0 | NVD |
| fedoraproject fedora | 35, 36 | NVD |
All scores
| GitHub_M | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:N/A:P |
| PyPA Advisory Database | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
Impact
What kind of vulnerability is it? Who is impacted?
When an error occurs while reallocating the buffer for string decoding, the buffer gets freed twice.
Due to how UltraJSON uses the internal decoder, this double free is impossible to trigger from Python.
Patches
Has the problem been patched? What versions should users upgrade to?
Users should upgrade to UltraJSON 5.4.0.
Workarounds
Is there a way for users to fix or remediate the vulnerability without upgrading?
There is no workaround.
For more information
If you have any questions or comments about this advisory:
- Open an issue in UltraJSON
NVD (es)
UltraJSON es un codificador y decodificador JSON rápido escrito en C puro con enlaces para Python versiones 3.7+. En versiones anteriores a la 5.4.0, un error al reasignar un búfer para la decodificación de cadenas puede hacer que el búfer se libere dos veces. Debido a cómo UltraJSON usa el decodificador interno, esta doble liberación es imposible de activar desde Python. Este problema ha sido resuelto en la versión 5.4.0 y todos los usuarios deben actualizar a UltraJSON 5.4.0. No se conocen mitigaciones adicionales para este problema
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-31117 changed 2025-04-23 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-fm67-cv37-96ff changed 2026-07-07 | CC-BY-4.0 |
| NVD | CVE-2022-31117 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2026-1056 changed 2026-07-07 | CC-BY-4.0 |