
CVE catalog
CVE-2021-40812
libgd2: CVE-2021-40812
- Severity
- Medium · CVSS 4
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N - Published
- Source
- [NVD] · [CVE record]
- EPSS
- 1.66% · Oct 27, 2026
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.
Vulnerable and fixed packages
Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.
| Distribution | Package | Release | Version | Status |
|---|---|---|---|---|
| Debian | libgd2 | sid | 2.3.3-14 | fixed |
| Debian | libgd2 | forky | 2.3.3-14 | fixed |
| Debian | libgd2 | trixie | 2.3.3-14~deb13u1 | fixed |
| Debian | libgd2 | trixie-security | 2.3.3-14~deb13u1 | fixed |
| Debian | libgd2 | bookworm | 2.3.3-9 | fixed |
| Debian | libgd2 | bookworm-security | 2.3.3-9+deb12u1 | fixed |
| Ubuntu | libgd2 | pro | 2.2.5-3 | vulnerable |
| Ubuntu | libgd2 | pro | 2.2.5-4 | vulnerable |
| Ubuntu | libgd2 | pro | 2.2.5-4ubuntu0.2 | vulnerable |
| Ubuntu | libgd2 | pro | 2.2.5-4ubuntu0.3 | vulnerable |
| Ubuntu | libgd2 | pro | 2.2.5-4ubuntu0.4 | vulnerable |
| Ubuntu | libgd2 | pro | 2.2.5-4ubuntu0.5 | vulnerable |
| Ubuntu | libgd2 | pro | 2.2.5-4ubuntu0.5+esm3 | fixed |
| Ubuntu | libgd2 | 20.04 | 2.2.5-5.2 | vulnerable |
| Ubuntu | libgd2 | 20.04 | 2.2.5-5.2ubuntu2 | vulnerable |
| Ubuntu | libgd2 | 20.04 | 2.2.5-5.2ubuntu2.1 | vulnerable |
| Ubuntu | libgd2 | 20.04 | 2.2.5-5.2ubuntu2.4 | fixed |
| Ubuntu | libgd2 | 22.04 | 2.3.0-2ubuntu1 | vulnerable |
| Ubuntu | libgd2 | 22.04 | 2.3.0-2ubuntu2 | vulnerable |
| Ubuntu | libgd2 | 22.04 | 2.3.0-2ubuntu2.3 | fixed |
| Ubuntu | libgd2 | pro | 2.2.5-3 | vulnerable |
| Ubuntu | libgd2 | pro | 2.2.5-4 | vulnerable |
| Ubuntu | libgd2 | pro | 2.2.5-4ubuntu0.2 | vulnerable |
| Ubuntu | libgd2 | pro | 2.2.5-4ubuntu0.3 | vulnerable |
| Ubuntu | libgd2 | pro | 2.2.5-4ubuntu0.4 | vulnerable |
| Ubuntu | libgd2 | pro | 2.2.5-4ubuntu0.5 | vulnerable |
| Ubuntu | libgd2 | pro | 2.2.5-4ubuntu0.5+esm3 | fixed |
| Ubuntu | libgd2 | 20.04 | 2.2.5-5.2 | vulnerable |
| Ubuntu | libgd2 | 20.04 | 2.2.5-5.2ubuntu2 | vulnerable |
| Ubuntu | libgd2 | 20.04 | 2.2.5-5.2ubuntu2.1 | vulnerable |
| Ubuntu | libgd2 | 20.04 | 2.2.5-5.2ubuntu2.4 | fixed |
| Ubuntu | libgd2 | 22.04 | 2.3.0-2ubuntu1 | vulnerable |
| Ubuntu | libgd2 | 22.04 | 2.3.0-2ubuntu2 | vulnerable |
| Ubuntu | libgd2 | 22.04 | 2.3.0-2ubuntu2.3 | fixed |
| Opensuse | gd | leap 15.3 | 2.2.5-11.3.1 | fixed |
| Suse | gd | linux enterprise software development kit 12 sp5 | 2.1.0-24.20.1 | fixed |
| Suse | gd | linux enterprise server 12 sp5 | 2.1.0-24.20.1 | fixed |
| Suse | gd | linux enterprise server for sap applications 12 sp5 | 2.1.0-24.20.1 | fixed |
| Suse | gd | linux enterprise workstation extension 12 sp5 | 2.1.0-24.20.1 | fixed |
| Suse | gd | linux enterprise module for basesystem 15 sp2 | 2.2.5-11.3.1 | fixed |
| Suse | gd | linux enterprise module for basesystem 15 sp3 | 2.2.5-11.3.1 | fixed |
| Suse | gd | linux enterprise module for desktop applications 15 sp2 | 2.2.5-11.3.1 | fixed |
| Suse | gd | linux enterprise module for desktop applications 15 sp3 | 2.2.5-11.3.1 | fixed |
| Suse | gd | linux enterprise module for package hub 15 sp2 | 2.2.5-11.3.1 | fixed |
| Suse | gd | linux enterprise module for package hub 15 sp3 | 2.2.5-11.3.1 | fixed |
Fixed-version evidence
| Distribution | Package | Type | Release | Fixed version | Urgency | Origin | Bugs |
|---|---|---|---|---|---|---|---|
| Debian | libgd2 | source | sid | 2.3.3-1 | not yet assigned | Not reported | Not reported |
| Debian | libgd2 | source | forky | 2.3.3-1 | not yet assigned | Not reported | Not reported |
| Debian | libgd2 | source | trixie | 2.3.3-1 | not yet assigned | Not reported | Not reported |
| Debian | libgd2 | source | bookworm | 2.3.3-1 | not yet assigned | Not reported | Not reported |
| Ubuntu | libgd2 | deb | pro | 2.2.5-4ubuntu0.5+esm3 | Not reported | USN-7112-1 | Not reported |
| Ubuntu | libgd2 | deb | 20.04 | 2.2.5-5.2ubuntu2.4 | Not reported | USN-7112-1 | Not reported |
| Ubuntu | libgd2 | deb | 22.04 | 2.3.0-2ubuntu2.3 | Not reported | USN-7112-1 | Not reported |
| Ubuntu | libgd2 | deb | pro | 2.2.5-4ubuntu0.5+esm3 | Not reported | UBUNTU-CVE-2021-40812 | Not reported |
| Ubuntu | libgd2 | deb | 20.04 | 2.2.5-5.2ubuntu2.4 | Not reported | UBUNTU-CVE-2021-40812 | Not reported |
| Ubuntu | libgd2 | deb | 22.04 | 2.3.0-2ubuntu2.3 | Not reported | UBUNTU-CVE-2021-40812 | Not reported |
| Opensuse | gd | rpm | leap 15.3 | 2.2.5-11.3.1 | Not reported | OPENSUSE-SU-2021:3236-1 | Not reported |
| Suse | gd | rpm | linux enterprise software development kit 12 sp5 | 2.1.0-24.20.1 | Not reported | SUSE-SU-2021:3214-1 | Not reported |
| Suse | gd | rpm | linux enterprise server 12 sp5 | 2.1.0-24.20.1 | Not reported | SUSE-SU-2021:3214-1 | Not reported |
| Suse | gd | rpm | linux enterprise server for sap applications 12 sp5 | 2.1.0-24.20.1 | Not reported | SUSE-SU-2021:3214-1 | Not reported |
| Suse | gd | rpm | linux enterprise workstation extension 12 sp5 | 2.1.0-24.20.1 | Not reported | SUSE-SU-2021:3214-1 | Not reported |
| Suse | gd | rpm | linux enterprise module for basesystem 15 sp2 | 2.2.5-11.3.1 | Not reported | SUSE-SU-2021:3236-1 | Not reported |
| Suse | gd | rpm | linux enterprise module for basesystem 15 sp3 | 2.2.5-11.3.1 | Not reported | SUSE-SU-2021:3236-1 | Not reported |
| Suse | gd | rpm | linux enterprise module for desktop applications 15 sp2 | 2.2.5-11.3.1 | Not reported | SUSE-SU-2021:3236-1 | Not reported |
| Suse | gd | rpm | linux enterprise module for desktop applications 15 sp3 | 2.2.5-11.3.1 | Not reported | SUSE-SU-2021:3236-1 | Not reported |
| Suse | gd | rpm | linux enterprise module for package hub 15 sp2 | 2.2.5-11.3.1 | Not reported | SUSE-SU-2021:3236-1 | Not reported |
| Suse | gd | rpm | linux enterprise module for package hub 15 sp3 | 2.2.5-11.3.1 | Not reported | SUSE-SU-2021:3236-1 | Not reported |
OpenFactory catalog packages
Matching against OpenFactory catalog package versions is in progress.
[Debian 12 (Bookworm)]
- [libgd3]Unknown
Source package: [libgd2]
Details (4)
2.3.3-9· amd64 · bookwormFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · bookworm; dsa · libgd2 · debian · 12
2.3.3-9· arm64 · bookwormFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · bookworm; dsa · libgd2 · debian · 12
2.3.3-9+deb12u1· amd64 · bookworm-securityFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · bookworm; dsa · libgd2 · debian · 12
2.3.3-9+deb12u1· arm64 · bookworm-securityFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · bookworm; dsa · libgd2 · debian · 12
- [libgd-dev]Unknown
Source package: [libgd2]
Details (4)
2.3.3-9· amd64 · bookwormFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · bookworm; dsa · libgd2 · debian · 12
2.3.3-9· arm64 · bookwormFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · bookworm; dsa · libgd2 · debian · 12
2.3.3-9+deb12u1· amd64 · bookworm-securityFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · bookworm; dsa · libgd2 · debian · 12
2.3.3-9+deb12u1· arm64 · bookworm-securityFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · bookworm; dsa · libgd2 · debian · 12
- [libgd-tools]Unknown
Source package: [libgd2]
Details (4)
2.3.3-9· amd64 · bookwormFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · bookworm; dsa · libgd2 · debian · 12
2.3.3-9· arm64 · bookwormFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · bookworm; dsa · libgd2 · debian · 12
2.3.3-9+deb12u1· amd64 · bookworm-securityFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · bookworm; dsa · libgd2 · debian · 12
2.3.3-9+deb12u1· arm64 · bookworm-securityFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · bookworm; dsa · libgd2 · debian · 12
[Debian 13 (Trixie)]
- [libgd3]Unknown
Source package: [libgd2]
Details (4)
2.3.3-13· amd64 · trixieFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · 13
2.3.3-13· arm64 · trixieFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · 13
2.3.3-14~deb13u1· amd64 · trixie-securityFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · 13
2.3.3-14~deb13u1· arm64 · trixie-securityFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · 13
- [libgd-dev]Unknown
Source package: [libgd2]
Details (4)
2.3.3-13· amd64 · trixieFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · 13
2.3.3-13· arm64 · trixieFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · 13
2.3.3-14~deb13u1· amd64 · trixie-securityFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · 13
2.3.3-14~deb13u1· arm64 · trixie-securityFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · 13
- [libgd-tools]Unknown
Source package: [libgd2]
Details (4)
2.3.3-13· amd64 · trixieFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · 13
2.3.3-13· arm64 · trixieFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · 13
2.3.3-14~deb13u1· amd64 · trixie-securityFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · 13
2.3.3-14~deb13u1· arm64 · trixie-securityFixed · Fixed:
2.3.3-1dsa · libgd2 · debian · 13
Observed:
References
- [https://ftp.suse.com/pub/projects/security/csaf/suse-su-2021_3214-1.json]
- [https://osv.dev/vulnerability/DEBIAN-CVE-2021-40812]
- [https://osv.dev/vulnerability/SUSE-SU-2021:3214-1]
- [https://osv.dev/vulnerability/SUSE-SU-2021:3236-1]
- [https://osv.dev/vulnerability/UBUNTU-CVE-2021-40812]
- [https://osv.dev/vulnerability/USN-7112-1]
- [https://osv.dev/vulnerability/openSUSE-SU-2021:3236-1]
- [https://security-tracker.debian.org/tracker/CVE-2021-40812]
- [https://wid.cert-bund.de/.well-known/csaf/white/2022/wid-sec-w-2022-0302.json]
[CERT-Bund public advisories] · [Debian Security Tracker] · [FIRST EPSS] · [OSV Package Vulnerability Database] · [SUSE security advisories and VEX]