CVE-2021-40145
CVE-2021-40145 is a high-severity vulnerability in Libgd with a CVSS 3.x base score of 7.5. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-415.
Key facts
- Severity: High (CVSS 3.x base score 7.5)
- CVSS v2: 5.0
- EPSS exploit prediction: 2% (79th percentile)
- Actively exploited: Not listed in CISA KEV
- Weakness: CWE-415
- Affected product: Libgd
- Published:
- Last modified:
Description
gdImageGd2Ptr in gd_gd2.c in the GD Graphics Library (aka LibGD) through 2.3.2 has a double free. NOTE: the vendor's position is "The GD2 image format is a proprietary image format of libgd. It has to be regarded as being obsolete, and should only be used for development and testing purposes.
Frequently asked questions
- What is CVE-2021-40145?
- gdImageGd2Ptr in gd_gd2.c in the GD Graphics Library (aka LibGD) through 2.3.2 has a double free. NOTE: the vendor's position is "The GD2 image format is a proprietary image format of libgd. It has to be regarded as being obsolete, and should only be used for development and testing purposes.
- How severe is CVE-2021-40145?
- CVE-2021-40145 has a CVSS 3.x base score of 7.5, rated high severity. It is exploitable over network with low attack complexity, requires no privileges and no user interaction. Impact on confidentiality is none, integrity none, and availability high.
- Is CVE-2021-40145 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 2% (79th percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2021-40145?
- CVE-2021-40145 affects Libgd. See the affected-products list for the exact vulnerable versions.
- How do I fix CVE-2021-40145?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its high severity, prioritise patching exposed systems.
- When was CVE-2021-40145 published?
- CVE-2021-40145 was published on 2021-08-26 and last updated on 2026-06-17.
References
- https://github.com/libgd/libgd/commit/c5fd25ce0e48fd5618a972ca9f5e28d6d62006af
- https://github.com/libgd/libgd/issues/700
- https://github.com/libgd/libgd/pull/713
Affected products (1)
- cpe:2.3:a:libgd:libgd:*:*:*:*:*:*:*:*
More vulnerabilities in Libgd
- CVE-2019-6978 — Critical (CVSS 9.8): The GD Graphics Library (aka LibGD) 2.2.5 has a double free in the gdImage*Ptr() functions in gd_gif_out.c, gd_jpeg.c,…
- CVE-2016-10166 — Critical (CVSS 9.8): Integer underflow in the _gdContributionsAlloc function in gd_interpolation.c in the GD Graphics Library (aka libgd)…
- CVE-2016-6912 — Critical (CVSS 9.8): Double free vulnerability in the gdImageWebPtr function in the GD Graphics Library (aka libgd) before 2.2.4 allows…
- CVE-2016-8670 — Critical (CVSS 9.8): Integer signedness error in the dynamicGetbuf function in gd_io_dp.c in the GD Graphics Library (aka libgd) through…
- CVE-2016-7568 — Critical (CVSS 9.8): Integer overflow in the gdImageWebpCtx function in gd_webp.c in the GD Graphics Library (aka libgd) through 2.2.3, as…
- CVE-2016-3074 — Critical (CVSS 9.8): Integer signedness error in GD Graphics Library 2.1.1 (aka libgd or libgd2) allows remote attackers to cause a denial…
Other CWE-415 (Double Free) vulnerabilities
- CVE-2018-0101 — Critical (CVSS 10.0): A vulnerability in the Secure Sockets Layer (SSL) VPN functionality of the Cisco Adaptive Security Appliance (ASA)…
- CVE-2026-8925 — Critical (CVSS 9.8): The curl logic that works with SASL authentication could end up cleaning up the GSASL context *twice* without clearing…
- CVE-2020-37239 — Critical (CVSS 9.8): libbabl 0.1.62 contains a broken double free detection vulnerability that allows attackers to bypass memory safety…
- CVE-2026-43414 — Critical (CVSS 9.8): In the Linux kernel, the following vulnerability has been resolved: scsi: qla2xxx: Completely fix fcport double…
- CVE-2026-43011 — Critical (CVSS 9.8): In the Linux kernel, the following vulnerability has been resolved: net/x25: Fix potential double free of skb When…
- CVE-2026-31609 — Critical (CVSS 9.8): In the Linux kernel, the following vulnerability has been resolved: smb: client: avoid double-free in…