cve.bz

CVE-2021-40812 libgd libgd: Out-of-bounds Read

6.5 mediumEPSS 1.7%Fix available

Medium (6.5) in libgd libgd. EPSS 1.7% estimated probability of exploitation activity in the next 30 days.

On this page
The GD Graphics Library (aka LibGD) through 2.3.2 has an out-of-bounds read because of the lack of certain gdGetBuf and gdPutBuf return value checks.

Severity

CVSS 3.1

6.5 medium
CVSS:3.1/AV:N/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.7% 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.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2024-07-30. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-125 Out-of-bounds Read
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-40812 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-40812?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-40812?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-40812 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
libgd:libgdthrough 2.3.2

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10libgd22.2.5-5.2+deb10u1DLA-3781-1
Debian11libgd22.3.0-2+deb11u1DLA-4411-1
Debian12, 13, 14libgd22.3.3-1DEBIAN-CVE-2021-40812
Ubuntu20.04:LTSlibgd22.2.5-5.2ubuntu2.4UBUNTU-CVE-2021-40812 USN-7112-1
Ubuntu22.04:LTSlibgd22.3.0-2ubuntu2.3UBUNTU-CVE-2021-40812 USN-7112-1
UbuntuPro:14.04:LTSlibgd2no fix listedUBUNTU-CVE-2021-40812
UbuntuPro:16.04:LTSlibgd22.1.1-4ubuntu0.16.04.12+esm4UBUNTU-CVE-2021-40812 USN-7112-1
UbuntuPro:18.04:LTSlibgd22.2.5-4ubuntu0.5+esm3UBUNTU-CVE-2021-40812 USN-7112-1
SUSELinux Enterprise Module for Basesystem 15 SP2, Linux Enterprise Module for Basesystem 15 SP3, Linux Enterprise Module for Desktop Applications 15 SP2 and 3 moregd2.2.5-11.3.1SUSE-SU-2021:3236-1
SUSELinux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5, Linux Enterprise Software Development Kit 12 SP5 and 1 moregd2.1.0-24.20.1SUSE-SU-2021:3214-1
openSUSELeap 15.3gd2.2.5-11.3.1openSUSE-SU-2021:3236-1
Azure Linux2gd2.3.3-1AZL-6433

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; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE.

Attack patterns (CAPEC)

  • CAPEC-540 Overread Buffers Likelihood: Low · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON