CVE-2021-40812
published 2021-09-08CVE-2021-40812: 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.
PriorityP427medium6.5CVSS 3.1
AVNACLPRNUIRSUCNINAH
EPSS
1.54%
71.8th percentile
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.
Affected
4 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | libgd2 | < libgd2 2.3.3-1 (bookworm) | libgd2 2.3.3-1 (bookworm) |
| libgd | libgd | <= 2.3.2 | — |
| msrc | cbl2_gd_2.3.3-1_on_cbl_mariner_2.0 | — | — |
| msrc | cm1_gd_2.3.3-1_on_cbl_mariner_1.0 | — | — |
CVSS provenance
nvdv3.16.5MEDIUMCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
nvdv2.04.3MEDIUMAV:N/AC:M/Au:N/C:N/I:N/A:P
osv6.5MEDIUM
vendor_debian6.5MEDIUM
vendor_msrc6.5MEDIUM
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
Ubuntu
GD Graphics Library vulnerability
vendor_ubuntu·2024-11-15
CVE-2021-40812 GD Graphics Library vulnerability
Title: GD Graphics Library vulnerability
Summary: GD Graphics Library could be made to crash if it opened a specially
crafted file.
It was discovered that the GD Graphics Library did not perform proper
bounds checking while handling BMP and WebP files. If a user were tricked
into opening a specially crafted file, an attacker could possibly use
this issue to cause a denial of service (application crash).
Instructions: In general, a standard system update will make all the necessary changes.
Microsoft
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.
vendor_msrc·2021-09-14·CVSS 6.5
CVE-2021-40812 [MEDIUM] CWE-125 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.
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.
FAQ: Is Azure Linux the only Microsoft product that includes this open-source library and is therefore potentially affected by this vulnerability?
One of the main benefits to our customers who choose to use the Azure Linux distro is the commitment to keep it up to date with the most recent and most secure versions of the open source libraries with which the distro is composed. Microsoft is committed to transparency in this work which is why we began publishing CSAF/VEX in October 2025. See this blog post for more information. If impact to additional products is identified, we will update the CVE to reflect this.
Mariner: Mariner
mitre: mit
Debian
CVE-2021-40812: libgd2 - The GD Graphics Library (aka LibGD) through 2.3.2 has an out-of-bounds read beca...
vendor_debian·2021·CVSS 6.5
CVE-2021-40812 [MEDIUM] CVE-2021-40812: libgd2 - The GD Graphics Library (aka LibGD) through 2.3.2 has an out-of-bounds read beca...
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.
Scope: local
bookworm: resolved (fixed in 2.3.3-1)
bullseye: resolved (fixed in 2.3.0-2+deb11u1)
forky: resolved (fixed in 2.3.3-1)
sid: resolved (fixed in 2.3.3-1)
trixie: resolved (fixed in 2.3.3-1)
GHSA
GHSA-53w9-wg73-ghrw: The GD Graphics Library (aka LibGD) through 2
ghsa_unreviewed·2022-05-24
CVE-2021-40812 [MEDIUM] CWE-125 GHSA-53w9-wg73-ghrw: The GD Graphics Library (aka LibGD) through 2
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.
OSV
CVE-2021-40812: The GD Graphics Library (aka LibGD) through 2
osv·2021-09-08·CVSS 6.5
CVE-2021-40812 [MEDIUM] CVE-2021-40812: The GD Graphics Library (aka LibGD) through 2
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.
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
https://github.com/libgd/libgd/commit/6f5136821be86e7068fcdf651ae9420b5d42e9a9https://github.com/libgd/libgd/issues/750#issuecomment-914872385https://lists.debian.org/debian-lts-announce/2024/04/msg00003.htmlhttps://github.com/libgd/libgd/commit/6f5136821be86e7068fcdf651ae9420b5d42e9a9https://github.com/libgd/libgd/issues/750#issuecomment-914872385https://lists.debian.org/debian-lts-announce/2024/04/msg00003.html
2021-09-08
Published