{"id":"CVE-2022-31117","aliases":["ALPINE-CVE-2022-31117","DEBIAN-CVE-2022-31117","EUVD-2022-6334","GHSA-fm67-cv37-96ff","MGASA-2022-0270","OESA-2026-3606","PYSEC-2026-1056","RHSA-2022:8850","RHSA-2022:8864","SUSE-SU-2022:2673-1","UBUNTU-CVE-2022-31117","USN-6629-1","USN-6629-3","openSUSE-SU-2024:12183-1","openSUSE-SU-2025:15107-1"],"status":"published","title":"Double free of buffer during string decoding in ujson","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.","severity":{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.01876,"percentile":0.79682,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-415"],"published":"2022-07-05T17:30:13Z","modified":"2026-11-03T08:01:29Z","fixes":[{"ecosystem":"PyPI","package":"ujson","fixed_in":["5.4.0"],"sources":["ghsa","osv"]},{"ecosystem":"Alpine:v3.16","package":"py3-ujson","fixed_in":["5.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.17","package":"py3-ujson","fixed_in":["5.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.18","package":"py3-ujson","fixed_in":["5.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.19","package":"py3-ujson","fixed_in":["5.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.20","package":"py3-ujson","fixed_in":["5.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.21","package":"py3-ujson","fixed_in":["5.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.22","package":"py3-ujson","fixed_in":["5.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.23","package":"py3-ujson","fixed_in":["5.4.0-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.24","package":"py3-ujson","fixed_in":["5.4.0-r0"],"sources":["osv"]},{"ecosystem":"Debian:12","package":"ujson","fixed_in":["5.4.0-1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"ujson","fixed_in":["5.4.0-1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"ujson","fixed_in":["5.4.0-1"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:16.04:LTS","package":"ujson","fixed_in":["1.33-1ubuntu0.1~esm2"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:18.04:LTS","package":"ujson","fixed_in":["1.35-2ubuntu0.1~esm1"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:22.04:LTS","package":"ujson","fixed_in":["5.1.0-1ubuntu0.1~esm1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.16","package":"py3-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.17","package":"py3-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.18","package":"py3-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.19","package":"py3-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.20","package":"py3-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.21","package":"py3-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.22","package":"py3-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.23","package":"py3-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.24","package":"py3-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0-r0"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0-1"}]}]},{"source":"osv","ecosystem":"Debian:13","package":"ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0-1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0-1"}]}]},{"source":"osv","ecosystem":"PyPI","package":"ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0"}]}],"versions":["1.15","1.18","1.19","1.21","1.22","1.23","1.30","1.33","1.34","1.35","1.4","1.6","1.8","1.9","2.0.0","2.0.1","2.0.2","2.0.3","3.0.0","3.1.0","3.2.0","4.0.0","4.0.1","4.0.2","4.1.0","4.2.0","4.3.0","5.0.0","5.1.0","5.2.0","5.3.0"]},{"source":"osv","ecosystem":"Mageia:8","package":"python-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0-1.mga8"}]}],"bundled":2},{"source":"osv","ecosystem":"openEuler:20.03-LTS-SP4","package":"python-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.0.2-3.oe2003sp4"}]}],"bundled":5},{"source":"osv","ecosystem":"PyPI","package":"ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.4.0"}]}],"versions":["1.15","1.18","1.19","1.21","1.22","1.23","1.30","1.33","1.34","1.35","1.4","1.6","1.8","1.9","2.0.0","2.0.1","2.0.2","2.0.3","3.0.0","3.1.0","3.2.0","4.0.0","4.0.1","4.0.2","4.1.0","4.2.0","4.3.0","5.0.0","5.1.0","5.2.0","5.3.0"]},{"source":"osv","ecosystem":"Red Hat:openstack:16.2::el8","package":"python-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0:2.0.3-3.el8ost"}]}],"bundled":2},{"source":"osv","ecosystem":"Red Hat:openstack:16.2::el8","package":"python-ujson-debugsource","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0:2.0.3-3.el8ost"}]}],"bundled":2},{"source":"osv","ecosystem":"Red Hat:openstack:16.2::el8","package":"python3-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0:2.0.3-3.el8ost"}]}],"bundled":2},{"source":"osv","ecosystem":"Red Hat:openstack:16.2::el8","package":"python3-ujson-debuginfo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0:2.0.3-3.el8ost"}]}],"bundled":2},{"source":"osv","ecosystem":"Red Hat:openstack:16.1::el8","package":"python-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0:2.0.3-3.el8ost"}]}],"bundled":2},{"source":"osv","ecosystem":"Red Hat:openstack:16.1::el8","package":"python-ujson-debugsource","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0:2.0.3-3.el8ost"}]}],"bundled":2},{"source":"osv","ecosystem":"Red Hat:openstack:16.1::el8","package":"python3-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0:2.0.3-3.el8ost"}]}],"bundled":2},{"source":"osv","ecosystem":"Red Hat:openstack:16.1::el8","package":"python3-ujson-debuginfo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0:2.0.3-3.el8ost"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP3","package":"python-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.35-150100.3.5.1"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","package":"python-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.35-150100.3.5.1"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Package Hub 15 SP3","package":"python-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.35-150100.3.5.1"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Package Hub 15 SP4","package":"python-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.35-150100.3.5.1"}]}],"bundled":2},{"source":"osv","ecosystem":"openSUSE:Leap 15.3","package":"python-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.35-150100.3.5.1"}]}],"bundled":2},{"source":"osv","ecosystem":"openSUSE:Leap 15.4","package":"python-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.35-150100.3.5.1"}]}],"bundled":2},{"source":"osv","ecosystem":"Ubuntu:14.04:LTS","package":"pandas","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.12.0-2ubuntu1","0.13.1-2ubuntu1","0.13.1-2ubuntu2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.33-1ubuntu0.1~esm2"}]}],"versions":["1.33-1","1.33-1build1"]},{"source":"osv","ecosystem":"Ubuntu:16.04:LTS","package":"collada2gltf","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["20140924-3"]},{"source":"osv","ecosystem":"Ubuntu:16.04:LTS","package":"pandas","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.15.0-2","0.15.0-2ubuntu1","0.15.0-2ubuntu2","0.17.1-3ubuntu2"]},{"source":"osv","ecosystem":"Ubuntu:18.04:LTS","package":"collada2gltf","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["20140924-4"]},{"source":"osv","ecosystem":"Ubuntu:18.04:LTS","package":"pandas","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.19.2-5.1ubuntu4","0.22.0-2ubuntu1","0.22.0-3","0.22.0-4","0.22.0-4ubuntu1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.35-2ubuntu0.1~esm1"}]}],"versions":["1.35-1build2","1.35-2"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"pandas","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.23.3+dfsg-4ubuntu1","0.23.3+dfsg-4ubuntu5","0.23.3+dfsg-4ubuntu6","0.25.3+dfsg-4","0.25.3+dfsg-4build1","0.25.3+dfsg-7"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"collada2gltf","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["20140924-7build1","20140924-8"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"pandas","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.1.5+dfsg-2","1.1.5+dfsg-2ubuntu1","1.3.5+dfsg-2","1.3.5+dfsg-2ubuntu1","1.3.5+dfsg-3"]},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.1.0-1ubuntu0.1~esm1"}]}],"versions":["4.0.2-1","4.0.2-1build1","4.2.0-1","5.1.0-1","5.1.0-1build1"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"pandas","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.5.3+dfsg-6","1.5.3+dfsg-6ubuntu1","1.5.3+dfsg-7ubuntu1","1.5.3+dfsg-10","2.1.4+dfsg-4ubuntu2","2.1.4+dfsg-7"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"pandas","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.2.3+dfsg-8build1","2.2.3+dfsg-9"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"pandas","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.3.3+dfsg-3ubuntu1","2.3.3+dfsg-3ubuntu3"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"pandas","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.2.3+dfsg-9","2.3.3+dfsg-1ubuntu1","2.3.3+dfsg-3","2.3.3+dfsg-3ubuntu1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.33-1ubuntu0.1~esm2"}]}],"versions":["1.33-1","1.33-1build1"],"bundled":3},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.35-2ubuntu0.1~esm1"}]}],"versions":["1.35-1build2","1.35-2"],"bundled":3},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.1.0-1ubuntu0.1~esm1"}]}],"versions":["4.0.2-1","4.0.2-1build1","4.2.0-1","5.1.0-1","5.1.0-1build1"],"bundled":3},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.35-4ubuntu0.1+esm1"}]}],"versions":["1.35-3build1","1.35-3build2","1.35-4","1.35-4build1","1.35-4ubuntu0.1"],"bundled":2},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"python-ujson","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.10.0-1.5"}]}],"bundled":3}],"products":[{"vendor":"fedoraproject","product":"fedora"},{"vendor":"ultrajson","product":"ultrajson"},{"vendor":"ultrajson_project","product":"ultrajson"}],"references":[{"url":"https://github.com/ultrajson/ultrajson/security/advisories/GHSA-fm67-cv37-96ff","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web","article","report"]},{"url":"https://github.com/ultrajson/ultrajson/commit/9c20de0f77b391093967e25d01fb48671104b15b","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web","report"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31117","tags":["advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7/"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2/"},{"url":"https://github.com/advisories/GHSA-fm67-cv37-96ff","tags":["advisory"]},{"url":"https://security.alpinelinux.org/vuln/CVE-2022-31117","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31117.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2022-31117","tags":["advisory"]},{"url":"https://github.com/ultrajson/ultrajson","tags":["package"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2","tags":["web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7","tags":["web"]},{"url":"https://advisories.mageia.org/MGASA-2022-0270.html","tags":["advisory"]},{"url":"https://bugs.mageia.org/show_bug.cgi?id=30663","tags":["report"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7/","tags":["web"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2026-3606","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-45958","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31116","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44660","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-54911","tags":["advisory"]},{"url":"https://pypi.org/project/ujson","tags":["package"]},{"url":"https://access.redhat.com/errata/RHSA-2022:8850","tags":["advisory"]},{"url":"https://access.redhat.com/security/updates/classification/#moderate","tags":["article"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2104739","tags":["report"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2104740","tags":["report"]},{"url":"https://security.access.redhat.com/data/csaf/v2/advisories/2022/rhsa-2022_8850.json","tags":["advisory"]},{"url":"https://access.redhat.com/security/cve/CVE-2022-31116","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2022-31116","tags":["advisory"]},{"url":"https://github.com/ultrajson/ultrajson/security/advisories/GHSA-wpqr-jcpx-745r","tags":["article"]},{"url":"https://access.redhat.com/security/cve/CVE-2022-31117","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2022-31117","tags":["advisory","report"]},{"url":"https://access.redhat.com/errata/RHSA-2022:8864","tags":["advisory"]},{"url":"https://security.access.redhat.com/data/csaf/v2/advisories/2022/rhsa-2022_8864.json","tags":["advisory"]},{"url":"https://www.suse.com/support/update/announcement/2022/suse-su-20222673-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1201254","tags":["report"]},{"url":"https://bugzilla.suse.com/1201255","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2022-31116","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2022-31117","tags":["web"]},{"url":"https://ubuntu.com/security/CVE-2022-31117","tags":["report"]},{"url":"https://ubuntu.com/security/notices/USN-6629-1","tags":["advisory"]},{"url":"https://ubuntu.com/security/notices/USN-6629-3","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2021-45958","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2022-31116","tags":["report"]},{"url":"","tags":["advisory"]},{"url":"https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/KL3RUIUL44VPVSZZRZRL4FQDR4CDAGSW/","tags":["advisory"]},{"url":"https://www.suse.com/security/cve/CVE-2021-45958","tags":["web"]}],"sources":{"cve":[{"id":"CVE-2022-31117","title":"Double free of buffer during string decoding in ujson","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.","status":"published","published":"2022-07-05T17:30:13Z","modified":"2025-04-23T18:05:03.67Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"cna"}],"cwes":["CWE-415"],"updated_at":"2026-11-02T14:34:35.279735Z"}],"euvd":[{"id":"EUVD-2022-6334","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.","status":"published","published":"2022-07-05T17:30:13Z","modified":"2025-04-23T18:05:03Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T20:52:09.919052Z"}],"ghsa":[{"id":"GHSA-fm67-cv37-96ff","title":"Potential double free of buffer during string decoding","description":"### 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)\n","status":"published","published":"2022-07-05T21:05:59Z","modified":"2023-01-27T05:05:22Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-415"],"updated_at":"2026-11-02T14:36:21.8171Z"}],"nvd":[{"id":"CVE-2022-31117","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.","status":"published","published":"2022-07-05T18:15:08.087Z","modified":"2026-06-17T04:44:50.313Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"secondary"},{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"primary"},{"version":"2.0","score":4.3,"vector":"AV:N/AC:M/Au:N/C:N/I:N/A:P","level":"medium","assessor":"primary"}],"cwes":["CWE-415"],"updated_at":"2026-11-02T14:07:22.966735Z"}],"osv":[{"id":"ALPINE-CVE-2022-31117","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.","status":"published","published":"2022-07-05T18:15:08.087Z","modified":"2026-11-03T07:30:51.83008893Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-03T07:50:01.054176Z"},{"id":"CVE-2022-31117","title":"Double free of buffer during string decoding in ujson","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.","status":"published","published":"2022-07-05T17:30:13Z","modified":"2026-11-11T10:46:26.295738168Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-415"],"updated_at":"2026-11-11T02:50:43.46164Z"},{"id":"DEBIAN-CVE-2022-31117","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.","status":"published","published":"2022-07-05T18:15:08.087Z","modified":"2026-11-03T08:01:29.971120906Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-03T08:25:01.007408Z"},{"id":"GHSA-fm67-cv37-96ff","title":"Potential double free of buffer during string decoding","description":"### 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)\n","status":"published","published":"2022-07-05T21:05:59Z","modified":"2026-07-07T11:56:23.468990297Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-415"],"updated_at":"2026-11-02T15:46:46.760785Z"},{"id":"OESA-2026-3606","title":"python-ujson security update","description":"UltraJSON\r\n\r\nSecurity Fix(es):\n\nUltraJSON (aka ujson) through 5.1.0 has a stack-based buffer overflow in Buffer_AppendIndentUnchecked (called from encode). Exploitation can, for example, use a large amount of indentation.(CVE-2021-45958)\n\nUltraJSON is a fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. Affected versions were found to improperly decode certain characters. JSON strings that contain escaped surrogate characters not part of a proper surrogate pair were decoded incorrectly. Besides corrupting strings, this allowed for potential key confusion and value overwriting in dictionaries. All users parsing JSON from untrusted sources are vulnerable. From version 5.4.0, UltraJSON decodes lone surrogates in the same way as the standard library\u0026apos;s `json` module does, preserving them in the parsed output. Users are advised to upgrade. There are no known workarounds for this issue.(CVE-2022-31116)\n\nUltraJSON 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.(CVE-2022-31117)\n\nUltraJSON is a fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. Prior to 5.12.1, when ujson.dump() writes to a file-like object and the write operation raises an exception, the serialized JSON string object is not decremented, leaking memory. Each failed write operation leaks the full size of the serialized payload. This vulnerability is fixed in 5.12.1.(CVE-2026-44660)\n\nUltraJSON is a fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. Prior to 5.13.0, ujson.dumps() (or ujson.dump() or ujson.encode()) have a reject_bytes=False option. When set, they may accept malformed or truncated UTF-8 byte sequences, silently rewriting them into different Unicode characters instead of rejecting them. This leads to input validation bypass and data integrity issues. This vulnerability is fixed in 5.13.0.(CVE-2026-54911)","status":"published","published":"2026-09-05T15:03:05Z","modified":"2026-09-05T15:16:25.986617277Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:47.217107Z"},{"id":"PYSEC-2026-1056","title":"Potential double free of buffer during string decoding","description":"### 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)\n","status":"published","published":"2026-07-06T08:03:30.989917Z","modified":"2026-07-07T11:46:02.150833922Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T15:52:54.622769Z"},{"id":"RHSA-2022:8850","title":"Red Hat Security Advisory: Red Hat OpenStack Platform 16.2.4 (python-ujson) security update","status":"published","published":"2024-09-16T09:00:25Z","modified":"2026-06-26T11:02:09Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:53:10.139266Z"},{"id":"RHSA-2022:8864","title":"Red Hat Security Advisory: Red Hat OpenStack Platform 16.1.9 (python-ujson) security update","status":"published","published":"2024-09-16T09:00:33Z","modified":"2026-01-14T11:05:15.098811Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:53:10.139266Z"},{"id":"UBUNTU-CVE-2022-31117","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.","status":"published","published":"2022-07-05T18:15:00Z","modified":"2026-10-17T12:56:22.014804074Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"},{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T16:53:53.899276Z"},{"id":"MGASA-2022-0270","title":"Updated python-ujson packages fix security vulnerability","description":"Add support for arbitrary size integers.\nReplace 'wchar_t' string decoding implementation with a 'uint32_t'-based\none; fix handling of surrogates on decoding (CVE-2022-31116)\nPotential double free of buffer during string decoding - Fix memory leak\non encoding errors when the buffer was resized - Integer parsing: always\ndetect overflows - Fix handling of surrogates on encoding (CVE-2022-31117)\n","status":"published","published":"2022-07-29T20:53:30Z","modified":"2026-04-16T04:41:59.55374127Z","updated_at":"2026-11-02T15:49:41.849028Z"},{"id":"openSUSE-SU-2024:12183-1","title":"python310-ujson-5.4.0-1.1 on GA media","description":"These are all security issues fixed in the python310-ujson-5.4.0-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2024-06-15T00:00:00Z","modified":"2026-02-04T02:32:58.622439Z","updated_at":"2026-11-02T16:58:35.485255Z"},{"id":"openSUSE-SU-2025:15107-1","title":"python311-ujson-5.10.0-1.5 on GA media","description":"These are all security issues fixed in the python311-ujson-5.10.0-1.5 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2025-05-17T00:00:00Z","modified":"2026-02-04T04:11:52.296481Z","updated_at":"2026-11-02T16:58:37.399567Z"},{"id":"SUSE-SU-2022:2673-1","title":"Security update for python-ujson","description":"This update for python-ujson fixes the following issues:\n\n- CVE-2022-31116: Fixed improper decoding of escaped surrogate characters (bsc#1201255).\n- CVE-2022-31117: Fixed a double free while reallocating a buffer for string decoding (bsc#1201254).\n","status":"published","published":"2022-08-04T12:07:43Z","modified":"2026-02-04T04:38:34.523216Z","updated_at":"2026-11-02T15:53:50.965375Z"},{"id":"USN-6629-1","title":"ujson vulnerabilities","description":"It was discovered that UltraJSON incorrectly handled certain input with\na large amount of indentation. An attacker could possibly use this issue\nto crash the program, resulting in a denial of service. (CVE-2021-45958)\n\nJake Miller discovered that UltraJSON incorrectly decoded certain\ncharacters. An attacker could possibly use this issue to cause key\nconfusion and overwrite values in dictionaries. (CVE-2022-31116)\n\nIt was discovered that UltraJSON incorrectly handled an error when\nreallocating a buffer for string decoding. An attacker could possibly\nuse this issue to corrupt memory. (CVE-2022-31117)\n","status":"published","published":"2024-02-14T01:41:18Z","modified":"2026-06-25T13:32:27.266709234Z","updated_at":"2026-11-02T16:58:17.914523Z"},{"id":"USN-6629-3","title":"ujson vulnerabilities","description":"USN-6629-1 fixed vulnerabilities in UltraJSON.\nThis update provides the corresponding updates for Ubuntu 20.04 LTS.\n\nOriginal advisory details:\n\n It was discovered that UltraJSON incorrectly handled certain input with\n a large amount of indentation. An attacker could possibly use this issue\n to crash the program, resulting in a denial of service. (CVE-2021-45958)\n \n Jake Miller discovered that UltraJSON incorrectly decoded certain\n characters. An attacker could possibly use this issue to cause key\n confusion and overwrite values in dictionaries. (CVE-2022-31116)\n \n It was discovered that UltraJSON incorrectly handled an error when\n reallocating a buffer for string decoding. An attacker could possibly\n use this issue to corrupt memory. (CVE-2022-31117)\n","status":"published","published":"2024-02-14T14:32:36Z","modified":"2026-04-27T17:04:58.569237Z","updated_at":"2026-11-02T16:58:17.914523Z"}]}}
