CVEfocus › CVE database › CVE-2021-40145

CVE-2021-40145

CVSS 7.5 HighEPSS 2.1% (higher than 83% of CVEs)Published 2021-08-26Updated 2024-08-04Assigner: mitre

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.

What to do

Fixed builds are available from Alpine, Debian, Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

20Fixed
2Fix pending
1Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 22.04libgd2Fixed2.3.0-2ubuntu1UBUNTU-CVE-2021-40145
Ubuntu 20.04libgd2Fixed2.2.5-5.2ubuntu2.1UBUNTU-CVE-2021-40145
Ubuntu 18.04libgd2Fixed2.2.5-4ubuntu0.5UBUNTU-CVE-2021-40145
Ubuntu 16.04libgd2Fix pending2.1.1-4ubuntu0.16.04.12+esm1 (Ubuntu Pro)UBUNTU-CVE-2021-40145
Ubuntu 16.04php7.0Not affected
vulnerable_code_not_present
Ubuntu 14.04libgd2Fix pending2.1.0-3ubuntu0.11+esm2 (Ubuntu Pro)UBUNTU-CVE-2021-40145
Debian 14libgd2Fixed2.3.3-1DEBIAN-CVE-2021-40145
Debian 13libgd2Fixed2.3.3-1DEBIAN-CVE-2021-40145
Debian 12libgd2Fixed2.3.3-1DEBIAN-CVE-2021-40145
Alpine Linux 3.24gdFixed2.3.0-r1ALPINE-CVE-2021-40145
Alpine Linux 3.23gdFixed2.3.0-r1ALPINE-CVE-2021-40145
Alpine Linux 3.22gdFixed2.3.0-r1ALPINE-CVE-2021-40145
Alpine Linux 3.21gdFixed2.3.0-r1ALPINE-CVE-2021-40145
Alpine Linux 3.20gdFixed2.3.0-r1ALPINE-CVE-2021-40145
Alpine Linux 3.19gdFixed2.3.0-r1ALPINE-CVE-2021-40145
Alpine Linux 3.18gdFixed2.3.0-r1ALPINE-CVE-2021-40145
Alpine Linux 3.17gdFixed2.3.0-r1ALPINE-CVE-2021-40145
Alpine Linux 3.16gdFixed2.3.0-r1ALPINE-CVE-2021-40145
Alpine Linux 3.15gdFixed2.3.0-r1ALPINE-CVE-2021-40145
Alpine Linux 3.14gdFixed2.3.0-r1ALPINE-CVE-2021-40145
Alpine Linux 3.13gdFixed2.3.0-r1ALPINE-CVE-2021-40145
Alpine Linux 3.12gdFixed2.3.0-r1ALPINE-CVE-2021-40145
Alpine Linux 3.11gdFixed2.2.5-r4ALPINE-CVE-2021-40145

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.