# CVE-2022-31117: Double free of buffer during string decoding in ujson

- Severity: Medium 5.9 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.88%, higher than 80% of CVEs (2026-12-01)
- Published: 2022-07-05T17:30:13.000Z
- Modified: 2026-07-07T11:56:23.468Z
- Also known as: GHSA-fm67-cv37-96ff, PYSEC-2026-1056
- Weaknesses: CWE-415
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- ultrajson ultrajson: < 5.4.0
- ujson (PyPI): before 5.4.0
- ultrajson_project ultrajson: before 5.4.0
- fedoraproject fedora: 35; 36

## Every score

- GitHub_M: CVSS:3.1 5.9 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 5.9 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 5.9 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:N/A:P`
- PyPA Advisory Database: CVSS:3.1 5.9 Medium `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> (third-party-advisory, web)
- <https://github.com/ultrajson/ultrajson/commit/9c20de0f77b391093967e25d01fb48671104b15b> (patch, third-party-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2/> (vendor-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-31117> (advisory)
- <https://github.com/ultrajson/ultrajson> (package)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7> (web)
- <https://pypi.org/project/ujson> (package)
- <https://github.com/advisories/GHSA-fm67-cv37-96ff> (advisory)

## Sources

- CVE List: [CVE-2022-31117](https://www.cve.org/CVERecord?id=CVE-2022-31117), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-fm67-cv37-96ff](https://github.com/advisories/GHSA-fm67-cv37-96ff), CC-BY-4.0, modified 2026-07-07
- NVD: [CVE-2022-31117](https://nvd.nist.gov/vuln/detail/CVE-2022-31117), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1056](https://osv.dev/vulnerability/PYSEC-2026-1056), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2022-31117 · Whole record: https://cve.day/CVE-2022-31117.json · Rebuilt by cve.day 2026-11-25T22:58:12.716Z
