# CVE-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 val…

- Severity: Medium 6.5 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.39%, higher than 73% of CVEs (2026-12-01)
- Published: 2021-09-08T00:00:00.000Z
- Modified: 2026-06-17T04:07:28.177Z
- Weaknesses: CWE-125
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: mitre

## Description

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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- libgd libgd: up to 2.3.2

## Every score

- CISA-ADP: 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`
- NVD: 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`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:N/A:P`

## References

- <https://github.com/libgd/libgd/commit/6f5136821be86e7068fcdf651ae9420b5d42e9a9> (patch, third-party-advisory)
- <https://github.com/libgd/libgd/issues/750#issuecomment-914872385> (patch, third-party-advisory)
- <https://lists.debian.org/debian-lts-announce/2024/04/msg00003.html> (mailing-list)

## Sources

- CVE List: [CVE-2021-40812](https://www.cve.org/CVERecord?id=CVE-2021-40812), CVE Terms of Use, modified 2024-10-29
- NVD: [CVE-2021-40812](https://nvd.nist.gov/vuln/detail/CVE-2021-40812), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-40812 · Whole record: https://cve.day/CVE-2021-40812.json · Rebuilt by cve.day 2026-11-25T22:58:03.814Z
