cve.bz

CVE-2021-45958 Out-of-bounds Write

5.5 mediumExploit referenceEPSS 1.7%Fix available

Medium (5.5). EPSS 1.7% estimated probability of exploitation activity in the next 30 days. Fixed in ujson 5.1.0, 5.2.0.

On this page
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.

Severity

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
EPSS
1.7% (unchanged from 1.7% a week ago; 1.6% 30 days ago) estimated probability of exploitation activity in the next 30 days; 77th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-787 Out-of-bounds Write
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-45958 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-45958?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-45958?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-45958 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
ultrajson_project:ultrajsonbefore 5.2.0
debian:debian_linux9.0
fedoraproject:fedora35
fedoraproject:fedora36
fedoraproject:fedora37

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-fh56-85cw-5pq6PyPIujson>=1.34 <5.2.05.2.0
PYSEC-2022-25PyPIujson>=4.0.2 <5.1.05.1.0

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian9ujson1.35-1+deb9u1DLA-2929-1
Debian12, 13, 14ujson5.2.0-1DEBIAN-CVE-2021-45958
Ubuntu14.04:LTS, 16.04:LTS, 18.04:LTS and 6 morepandasno fix listedUBUNTU-CVE-2021-45958
Ubuntu20.04:LTSujson1.35-4ubuntu0.1UBUNTU-CVE-2021-45958 USN-6629-2
UbuntuPro:16.04:LTSujson1.33-1ubuntu0.1~esm2UBUNTU-CVE-2021-45958 USN-6629-1
UbuntuPro:18.04:LTSujson1.35-2ubuntu0.1~esm1UBUNTU-CVE-2021-45958 USN-6629-1
UbuntuPro:22.04:LTSujson5.1.0-1ubuntu0.1~esm1UBUNTU-CVE-2021-45958 USN-6629-1
SUSELinux Enterprise Module for Development Tools 15 SP4, Linux Enterprise Module for Package Hub 15 SP4, Linux Enterprise Real Time 15 SP3python-ujson1.35-150100.3.8.1SUSE-SU-2023:2134-1
openSUSELeap 15.4python-ujson1.35-150100.3.8.1SUSE-SU-2023:2134-1
openSUSETumbleweedpython-ujson5.10.0-1.5openSUSE-SU-2025:15107-1
Alpinev3.16, v3.17, v3.18 and 6 morepy3-ujson5.2.0-r0ALPINE-CVE-2021-45958

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE · Alpine.

References

Check your stackJSON