Skip to content
Fencer Vulns
medium 5.5

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

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

References

Sources

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.