{"id":"CVE-2022-31117","aliases":["CVE-2022-31117","GHSA-fm67-cv37-96ff","PYSEC-2026-1056"],"related":[],"kind":"vulnerability","state":"published","title":"Double free of buffer during string decoding in ujson","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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\nWhen an error occurs while reallocating the buffer for string decoding, the buffer gets freed twice.\n\nDue to how UltraJSON uses the internal decoder, this double free is impossible to trigger from Python.\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n\nUsers should upgrade to UltraJSON 5.4.0.\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nThere is no workaround.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [UltraJSON](http://github.com/ultrajson/ultrajson/issues)","format":"markdown","source":"ghsa"},{"lang":"es","text":"UltraJSON es un codificador y decodificador JSON rápido escrito en C puro con enlaces para Python versiones 3.7+.&#xa0;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.&#xa0;Debido a cómo UltraJSON usa el decodificador interno, esta doble liberación es imposible de activar desde Python.&#xa0;Este problema ha sido resuelto en la versión 5.4.0 y todos los usuarios deben actualizar a UltraJSON 5.4.0.&#xa0;No se conocen mitigaciones adicionales para este problema","source":"nvd"}],"published":"2022-07-05T17:30:13.000Z","modified":"2026-07-07T11:56:23.468Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:N/I:N/A:P","score":4.3,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"}],"cwes":["CWE-415"],"affected":[{"ranges":[{"version":"< 5.4.0","status":"affected"}],"vendor":"ultrajson","product":"ultrajson","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"5.4.0"}],"ecosystem":"PyPI","package":"ujson","purl":"pkg:pypi/ujson","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"5.4.0"}],"vendor":"ultrajson_project","product":"ultrajson","cpe":"cpe:2.3:a:ultrajson_project:ultrajson:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"35"},{"status":"affected","version":"36"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"5.4.0"}],"ecosystem":"PyPI","package":"ujson","purl":"pkg:pypi/ujson","source":"pysec"}],"references":[{"url":"https://github.com/ultrajson/ultrajson/security/advisories/GHSA-fm67-cv37-96ff","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/ultrajson/ultrajson/commit/9c20de0f77b391093967e25d01fb48671104b15b","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7/","tags":["vendor-advisory","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2/","tags":["vendor-advisory","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31117","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/ultrajson/ultrajson","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/ujson","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-fm67-cv37-96ff","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-04-23T14:03:59.440Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-31117","url":"https://www.cve.org/CVERecord?id=CVE-2022-31117","licence":"CVE Terms of Use","modified":"2025-04-23T18:05:03.670Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fm67-cv37-96ff","url":"https://github.com/advisories/GHSA-fm67-cv37-96ff","licence":"CC-BY-4.0","modified":"2026-07-07T11:56:23.468Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-31117","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31117","licence":"Public domain","modified":"2026-06-17T04:44:50.313Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1056","url":"https://osv.dev/vulnerability/PYSEC-2026-1056","licence":"CC-BY-4.0","modified":"2026-07-07T11:46:02.150Z"}],"updatedAt":"2026-11-25T22:58:12.716Z","epss":{"score":0.01876,"percentile":0.80012,"date":"2026-12-01T12:00:22.000Z"}}