CVE-2021-45958 json
UltraJSON vulnerable to Out-of-bounds Write
published 2021-12-31 4 y ago modified 2026-06-17 4 mo ago also GHSA-fh56-85cw-5pq6 , PYSEC-2022-25 , EUVD-2022-0348
- cvss
- 5.5
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.7%
- EPSS 1.7% chance of exploitation in 30 days, percentile 76%
- public exploits
- 0
- none known
Summary
UltraJSON (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.
Patch / fix
- pypi ujson 5.1.0, 5.2.0
- ultrajson_project ultrajson 5.2.0
- ujson Debian 14, Debian 13, Debian 12 5.2.0-1
debian advisories DEBIAN-CVE-2021-45958
- ujson Ubuntu 20.04 LTS 1.35-4ubuntu0.1
- ujson Ubuntu Pro 16.04 LTS 1.33-1ubuntu0.1~esm2
- ujson Ubuntu Pro 18.04 LTS 1.35-2ubuntu0.1~esm1
- ujson Ubuntu Pro 22.04 LTS 5.1.0-1ubuntu0.1~esm1
ubuntu advisories UBUNTU-CVE-2021-45958
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- python-ujson SLE Real Time 15 SP3, SLE Module for Package Hub 15 SP4, SLE Module for Development Tools 15 SP4 +1 more 1.35-150100.3.8.1
suse advisories SUSE-SU-2023:2134-1
- python-ujson openSUSE Tumbleweed 5.10.0-1.5
opensuse advisories openSUSE-SU-2025:15107-1
- py3-ujson Alpine 3.24, Alpine 3.23, Alpine 3.22 +6 more 5.2.0-r0
alpine advisories ALPINE-CVE-2021-45958
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- github.com/ultrajson/ultrajson#504 pull request
- github.com/ultrajson/ultrajson#519 pull request
- github.com/ultrajson/ultrajson/issues/502#issuecomment-1031747284 advisory
Exploit prediction
1.67% chance of exploitation in the next 30 days, higher than 76% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/google/oss-fuzz-vulns/blob/main/vulns/ujson/OSV-2021-955.yaml referenced PoC, tagged "exploit" by a source, unverified
- bugs.chromium.org https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36009 referenced PoC, tagged "exploit" by a source, unverified
- github.com https://github.com/ultrajson/ultrajson/issues/501 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 5.5 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
| NVD | 2.0 | 4.3 | AV:N/AC:M/Au:N/C:N/I:N/A:P |
| GitHub | 3.1 | 5.5 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | ujson | >=1.34, <5.2.0 >=4.0.2, <5.1.0 |
5.2.0 5.1.0 |
Classification
- Weakness
-
- CWE-787 Out-of-bounds Write
References
-
github.com
/ultrajson/ultrajson/pull/504
web, patch, third-party-advisory
-
github.com
/ultrajson/ultrajson/issues/502#issuecomment-1031747284
web, issue-tracking, patch, third-party-advisory, report
-
github.com
/ultrajson/ultrajson/pull/519
web
-
github.com
/google/oss-fuzz-vulns/blob/main/vulns/ujson/OSV-2021-955.yaml
web, exploit, third-party-advisory
-
bugs.chromium.org
/p/oss-fuzz/issues/detail?id=36009
web, exploit, issue-tracking, third-party-advisory
-
github.com
/ultrajson/ultrajson/issues/501
web, exploit, issue-tracking, third-party-advisory, report
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/CN7W3GOXALINKFUUE7ICQIC2EF5HNKUQ/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/ULX35TSWLBBIMEH44MUORPXYYRZKEDC6/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/O6JUWQTJLA2CMG4CJN7DCUVSOXLZIIXL/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2/
vendor-advisory
-
lists.debian.org
/debian-lts-announce/2022/02/msg00023.html
mailing-list, web, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-45958
advisory
-
github.com
/advisories/GHSA-fh56-85cw-5pq6
advisory
-
github.com
/pypa/advisory-database/tree/main/vulns/ujson/PYSEC-2022-25.yaml
web
-
github.com
/ultrajson/ultrajson
package
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/CN7W3GOXALINKFUUE7ICQIC2EF5HNKUQ
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/O6JUWQTJLA2CMG4CJN7DCUVSOXLZIIXL
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/ULX35TSWLBBIMEH44MUORPXYYRZKEDC6
web
Sources
- CVE List CVE-2021-45958
- GitHub Advisory GHSA-fh56-85cw-5pq6
- NVD CVE-2021-45958
- OSV PYSEC-2022-25
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.