CVE-2021-40145: libgd Double Free
Vulnerability summary
CVE-2021-40145 is a high (CVSS 7.5) Double Free vulnerability in libgd. EPSS estimates a 2.13% chance of exploitation in the next 30 days, higher than 82% of scored vulnerabilities. 1 public exploit is recorded.
Public exploit (GitHub, Date unknown)
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 3 · Related 1Timeline
- 26-08-2021PublishedVulnerability first disclosed.
- 04-08-2024Last modifiedVulnerability information updated.
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.
CVSS metrics
5 scores · 4 sources · 2 versions- OSV · AlpineEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- OSV · UbuntuEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- OSV · DebianEcosystem advisory · calculated7.5HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS trend
Probability
2.13%
Chance of exploitation in the next 30 days
Percentile
82%
Versus all other CVEs
30-day change
Increase +0.08 pp
From 2.05% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
1 foundLibgd
Maturity: poc
Weaknesses
CWE · root causeAffected systems
Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Alpine1 product
- gd< 2.2.5-r4 | < 2.3.0-r1
Debian1 product
- libgd2< 2.3.3-1
Libgd1 product
- libgd≤ 2.3.2
Ubuntu1 product
- libgd2< 2.1.0-3ubuntu0.11+esm2 | < 2.1.1-4ubuntu0.16.04.12+esm1 | < 2.2.5-4ubuntu0.5 | < 2.2.5-5.2ubuntu2.1 | < 2.3.0-2ubuntu1
4 vendors · 4 products
References
9 links- github.com/libgd/libgd/commit/c5fd25ce0e48fd5618a972ca9f5e28d6d62006afX Refsource MISCREPORTPatchThird Party Advisory