Medium
Security advisory
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2021-40812
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 11:54 UTC · Revision 1
Source evidence
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
Complete source record
{
"id": "bbdb639d43773c587ba9d977179647721a7bd086ab2aeeae259b8efe0719c4e9",
"url": "https://osv.dev/vulnerability/CVE-2021-40812",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2021-40812",
"summary": "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.",
"evidence": "osv:CVE-2021-40812",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2021-40812",
"aliases": [
"CVE-2021-40812"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/libgd/libgd",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"last_affected": "2e40f55bfb460fc9d8cbcd290a0c9eb908d5af7e"
},
{
"fixed": "6f5136821be86e7068fcdf651ae9420b5d42e9a9"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:libgd:libgd:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "0"
},
{
"last_affected": "2.3.2"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "6f5136821be86e7068fcdf651ae9420b5d42e9a9"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"gd-2.3.2",
"gd-2.3.1",
"gd-2.3.0",
"gd-2.1.1",
"gd-2.1.0",
"gd-2.1.0-rc1",
"gd-2.1.0-alpha1",
"GD_2_0_34RC1",
"GD_2_0_33",
"GD_2_0_32",
"GD_2_0_31",
"GD_2_0_30",
"GD_2_0_29",
"GD_2_0_28",
"GD_2_0_27",
"GD_2_0_26",
"GD_2_0_25",
"GD_2_0_24",
"GD_2_0_23",
"GD_2_0_22",
"GD_2_0_21",
"GD_2_0_20",
"GD_2_0_19",
"GD_2_0_18",
"GD_2_0_17",
"GD_2_0_15",
"GD_2_0_14",
"GD_2_0_13",
"GD_2_0_12",
"GD_2_0_11",
"GD_2_0_10",
"GD_2_0_9",
"GD_2_0_8",
"GD_2_0_7",
"GD_2_0_6",
"GD_2_0_5",
"GD_2_0_4",
"GD_2_0_3",
"GD_2_0_2",
"GD_2_0_1",
"GD_2_0_0",
"GD_1_8_4",
"GD_1_8_3",
"GD_1_8_1",
"GD_1_8_0",
"GD_1_7_3",
"GD_1_7_2",
"GD_1_7_1",
"GD_1_7_0",
"GD_1_6_3",
"GD_1_6_2",
"GD_1_6_1",
"GD_1_6_0",
"GD_1_5_0",
"GD_1_4_0",
"GD_1_3_0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-40812.json"
}
}
],
"modified": "2026-10-20T10:54:56.473865542Z",
"provider": "osv",
"references": [
"https://lists.debian.org/debian-lts-announce/2024/04/msg00003.html",
"https://github.com/libgd/libgd/commit/6f5136821be86e7068fcdf651ae9420b5d42e9a9",
"https://github.com/libgd/libgd/issues/750#issuecomment-914872385"
],
"provider_metadata": {}
},
"related_cves": [
{
"value": "CVE-2021-40812",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 386497,
"published_at": "2021-09-08T21:15:14.083+00:00"
}