# CVE-2021-45958: UltraJSON vulnerable to Out-of-bounds Write

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/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.67%, higher than 77% of CVEs (2026-11-30)
- Public exploit code or proof of concept: 3 links below, marked "exploit"
- Published: 2021-12-31T23:52:45.000Z
- Modified: 2026-06-17T04:14:19.740Z
- Also known as: GHSA-fh56-85cw-5pq6, PYSEC-2022-25
- Weaknesses: CWE-787
- Assigned by: mitre

## Description

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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- ujson (PyPI): from 1.34 before 5.2.0; from 4.0.2 before 5.1.0
- ultrajson_project ultrajson: before 5.2.0
- debian debian_linux: 9.0
- fedoraproject fedora: 35; 36; 37

## Every score

- GitHub: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/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`

## References

- <https://github.com/google/oss-fuzz-vulns/blob/main/vulns/ujson/OSV-2021-955.yaml> (exploit, third-party-advisory, web)
- <https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36009> (exploit, issue-tracking, third-party-advisory, web)
- <https://github.com/ultrajson/ultrajson/issues/501> (exploit, issue-tracking, report, third-party-advisory, web)
- <https://github.com/ultrajson/ultrajson/issues/502#issuecomment-1031747284> (issue-tracking, patch, report, third-party-advisory, web)
- <https://github.com/ultrajson/ultrajson/pull/504> (patch, third-party-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2022/02/msg00023.html> (mailing-list, third-party-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CN7W3GOXALINKFUUE7ICQIC2EF5HNKUQ/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ULX35TSWLBBIMEH44MUORPXYYRZKEDC6/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/O6JUWQTJLA2CMG4CJN7DCUVSOXLZIIXL/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2/> (vendor-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-45958> (advisory)
- <https://github.com/ultrajson/ultrajson/pull/519> (web)
- <https://github.com/advisories/GHSA-fh56-85cw-5pq6> (advisory)
- <https://github.com/pypa/advisory-database/tree/main/vulns/ujson/PYSEC-2022-25.yaml> (web)
- <https://github.com/ultrajson/ultrajson> (package)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CN7W3GOXALINKFUUE7ICQIC2EF5HNKUQ> (web)
- <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/O6JUWQTJLA2CMG4CJN7DCUVSOXLZIIXL> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ULX35TSWLBBIMEH44MUORPXYYRZKEDC6> (web)

## Sources

- CVE List: [CVE-2021-45958](https://www.cve.org/CVERecord?id=CVE-2021-45958), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-fh56-85cw-5pq6](https://github.com/advisories/GHSA-fh56-85cw-5pq6), CC-BY-4.0, modified 2024-11-18
- NVD: [CVE-2021-45958](https://nvd.nist.gov/vuln/detail/CVE-2021-45958), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2022-25](https://osv.dev/vulnerability/PYSEC-2022-25), CC-BY-4.0, modified 2023-11-08

---

Page: https://cve.day/CVE-2021-45958 · Whole record: https://cve.day/CVE-2021-45958.json · Rebuilt by cve.day 2026-11-25T22:58:06.317Z
