{"id":"ALPINE-CVE-2021-40145","details":"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.","modified":"2025-12-03T22:48:52.065739Z","published":"2021-08-26T01:15:11.747Z","upstream":["CVE-2021-40145"],"references":[{"type":"ADVISORY","url":"https://security.alpinelinux.org/vuln/CVE-2021-40145"}],"affected":[{"package":{"name":"gd","ecosystem":"Alpine:v3.11","purl":"pkg:apk/alpine/gd?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.2.5-r4"}]}],"versions":["2.0.35-r0","2.0.35-r1","2.0.35-r2","2.0.36_rc1-r0","2.0.36_rc1-r1","2.0.36_rc1-r2","2.0.36_rc1-r3","2.0.36_rc1-r4","2.0.36_rc1-r5","2.0.36_rc1-r6","2.0.36_rc1-r7","2.0.36_rc1-r8","2.0.36_rc1-r9","2.1.0-r0","2.1.0-r1","2.1.1-r0","2.2.1-r0","2.2.3-r0","2.2.3-r1","2.2.4-r0","2.2.4-r1","2.2.4-r2","2.2.5-r0","2.2.5-r1","2.2.5-r2","2.2.5-r3"],"ecosystem_specific":{},"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-40145.json"}},{"package":{"name":"gd","ecosystem":"Alpine:v3.12","purl":"pkg:apk/alpine/gd?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.0-r1"}]}],"versions":["2.0.35-r0","2.0.35-r1","2.0.35-r2","2.0.36_rc1-r0","2.0.36_rc1-r1","2.0.36_rc1-r2","2.0.36_rc1-r3","2.0.36_rc1-r4","2.0.36_rc1-r5","2.0.36_rc1-r6","2.0.36_rc1-r7","2.0.36_rc1-r8","2.0.36_rc1-r9","2.1.0-r0","2.1.0-r1","2.1.1-r0","2.2.1-r0","2.2.3-r0","2.2.3-r1","2.2.4-r0","2.2.4-r1","2.2.4-r2","2.2.5-r0","2.2.5-r1","2.2.5-r2","2.3.0-r0"],"ecosystem_specific":{},"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-40145.json"}},{"package":{"name":"gd","ecosystem":"Alpine:v3.13","purl":"pkg:apk/alpine/gd?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.0-r1"}]}],"versions":["2.0.35-r0","2.0.35-r1","2.0.35-r2","2.0.36_rc1-r0","2.0.36_rc1-r1","2.0.36_rc1-r2","2.0.36_rc1-r3","2.0.36_rc1-r4","2.0.36_rc1-r5","2.0.36_rc1-r6","2.0.36_rc1-r7","2.0.36_rc1-r8","2.0.36_rc1-r9","2.1.0-r0","2.1.0-r1","2.1.1-r0","2.2.1-r0","2.2.3-r0","2.2.3-r1","2.2.4-r0","2.2.4-r1","2.2.4-r2","2.2.5-r0","2.2.5-r1","2.2.5-r2","2.3.0-r0"],"ecosystem_specific":{},"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-40145.json"}},{"package":{"name":"gd","ecosystem":"Alpine:v3.14","purl":"pkg:apk/alpine/gd?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.0-r1"}]}],"versions":["2.0.35-r0","2.0.35-r1","2.0.35-r2","2.0.36_rc1-r0","2.0.36_rc1-r1","2.0.36_rc1-r2","2.0.36_rc1-r3","2.0.36_rc1-r4","2.0.36_rc1-r5","2.0.36_rc1-r6","2.0.36_rc1-r7","2.0.36_rc1-r8","2.0.36_rc1-r9","2.1.0-r0","2.1.0-r1","2.1.1-r0","2.2.1-r0","2.2.3-r0","2.2.3-r1","2.2.4-r0","2.2.4-r1","2.2.4-r2","2.2.5-r0","2.2.5-r1","2.2.5-r2","2.3.0-r0"],"ecosystem_specific":{},"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-40145.json"}},{"package":{"name":"gd","ecosystem":"Alpine:v3.15","purl":"pkg:apk/alpine/gd?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.0-r1"}]}],"versions":["2.0.35-r0","2.0.35-r1","2.0.35-r2","2.0.36_rc1-r0","2.0.36_rc1-r1","2.0.36_rc1-r2","2.0.36_rc1-r3","2.0.36_rc1-r4","2.0.36_rc1-r5","2.0.36_rc1-r6","2.0.36_rc1-r7","2.0.36_rc1-r8","2.0.36_rc1-r9","2.1.0-r0","2.1.0-r1","2.1.1-r0","2.2.1-r0","2.2.3-r0","2.2.3-r1","2.2.4-r0","2.2.4-r1","2.2.4-r2","2.2.5-r0","2.2.5-r1","2.2.5-r2","2.3.0-r0"],"ecosystem_specific":{},"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-40145.json"}},{"package":{"name":"gd","ecosystem":"Alpine:v3.16","purl":"pkg:apk/alpine/gd?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.0-r1"}]}],"versions":["2.0.35-r0","2.0.35-r1","2.0.35-r2","2.0.36_rc1-r0","2.0.36_rc1-r1","2.0.36_rc1-r2","2.0.36_rc1-r3","2.0.36_rc1-r4","2.0.36_rc1-r5","2.0.36_rc1-r6","2.0.36_rc1-r7","2.0.36_rc1-r8","2.0.36_rc1-r9","2.1.0-r0","2.1.0-r1","2.1.1-r0","2.2.1-r0","2.2.3-r0","2.2.3-r1","2.2.4-r0","2.2.4-r1","2.2.4-r2","2.2.5-r0","2.2.5-r1","2.2.5-r2","2.3.0-r0"],"ecosystem_specific":{},"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-40145.json"}},{"package":{"name":"gd","ecosystem":"Alpine:v3.17","purl":"pkg:apk/alpine/gd?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.0-r1"}]}],"versions":["2.0.35-r0","2.0.35-r1","2.0.35-r2","2.0.36_rc1-r0","2.0.36_rc1-r1","2.0.36_rc1-r2","2.0.36_rc1-r3","2.0.36_rc1-r4","2.0.36_rc1-r5","2.0.36_rc1-r6","2.0.36_rc1-r7","2.0.36_rc1-r8","2.0.36_rc1-r9","2.1.0-r0","2.1.0-r1","2.1.1-r0","2.2.1-r0","2.2.3-r0","2.2.3-r1","2.2.4-r0","2.2.4-r1","2.2.4-r2","2.2.5-r0","2.2.5-r1","2.2.5-r2","2.3.0-r0"],"ecosystem_specific":{},"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-40145.json"}},{"package":{"name":"gd","ecosystem":"Alpine:v3.18","purl":"pkg:apk/alpine/gd?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.0-r1"}]}],"versions":["2.0.35-r0","2.0.35-r1","2.0.35-r2","2.0.36_rc1-r0","2.0.36_rc1-r1","2.0.36_rc1-r2","2.0.36_rc1-r3","2.0.36_rc1-r4","2.0.36_rc1-r5","2.0.36_rc1-r6","2.0.36_rc1-r7","2.0.36_rc1-r8","2.0.36_rc1-r9","2.1.0-r0","2.1.0-r1","2.1.1-r0","2.2.1-r0","2.2.3-r0","2.2.3-r1","2.2.4-r0","2.2.4-r1","2.2.4-r2","2.2.5-r0","2.2.5-r1","2.2.5-r2","2.3.0-r0"],"ecosystem_specific":{},"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-40145.json"}},{"package":{"name":"gd","ecosystem":"Alpine:v3.19","purl":"pkg:apk/alpine/gd?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.0-r1"}]}],"versions":["2.0.35-r0","2.0.35-r1","2.0.35-r2","2.0.36_rc1-r0","2.0.36_rc1-r1","2.0.36_rc1-r2","2.0.36_rc1-r3","2.0.36_rc1-r4","2.0.36_rc1-r5","2.0.36_rc1-r6","2.0.36_rc1-r7","2.0.36_rc1-r8","2.0.36_rc1-r9","2.1.0-r0","2.1.0-r1","2.1.1-r0","2.2.1-r0","2.2.3-r0","2.2.3-r1","2.2.4-r0","2.2.4-r1","2.2.4-r2","2.2.5-r0","2.2.5-r1","2.2.5-r2","2.3.0-r0"],"ecosystem_specific":{},"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-40145.json"}},{"package":{"name":"gd","ecosystem":"Alpine:v3.20","purl":"pkg:apk/alpine/gd?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.0-r1"}]}],"versions":["2.0.35-r0","2.0.35-r1","2.0.35-r2","2.0.36_rc1-r0","2.0.36_rc1-r1","2.0.36_rc1-r2","2.0.36_rc1-r3","2.0.36_rc1-r4","2.0.36_rc1-r5","2.0.36_rc1-r6","2.0.36_rc1-r7","2.0.36_rc1-r8","2.0.36_rc1-r9","2.1.0-r0","2.1.0-r1","2.1.1-r0","2.2.1-r0","2.2.3-r0","2.2.3-r1","2.2.4-r0","2.2.4-r1","2.2.4-r2","2.2.5-r0","2.2.5-r1","2.2.5-r2","2.3.0-r0"],"ecosystem_specific":{},"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-40145.json"}},{"package":{"name":"gd","ecosystem":"Alpine:v3.21","purl":"pkg:apk/alpine/gd?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.0-r1"}]}],"versions":["2.0.35-r0","2.0.35-r1","2.0.35-r2","2.0.36_rc1-r0","2.0.36_rc1-r1","2.0.36_rc1-r2","2.0.36_rc1-r3","2.0.36_rc1-r4","2.0.36_rc1-r5","2.0.36_rc1-r6","2.0.36_rc1-r7","2.0.36_rc1-r8","2.0.36_rc1-r9","2.1.0-r0","2.1.0-r1","2.1.1-r0","2.2.1-r0","2.2.3-r0","2.2.3-r1","2.2.4-r0","2.2.4-r1","2.2.4-r2","2.2.5-r0","2.2.5-r1","2.2.5-r2","2.3.0-r0"],"ecosystem_specific":{},"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-40145.json"}},{"package":{"name":"gd","ecosystem":"Alpine:v3.22","purl":"pkg:apk/alpine/gd?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.0-r1"}]}],"versions":["2.0.35-r0","2.0.35-r1","2.0.35-r2","2.0.36_rc1-r0","2.0.36_rc1-r1","2.0.36_rc1-r2","2.0.36_rc1-r3","2.0.36_rc1-r4","2.0.36_rc1-r5","2.0.36_rc1-r6","2.0.36_rc1-r7","2.0.36_rc1-r8","2.0.36_rc1-r9","2.1.0-r0","2.1.0-r1","2.1.1-r0","2.2.1-r0","2.2.3-r0","2.2.3-r1","2.2.4-r0","2.2.4-r1","2.2.4-r2","2.2.5-r0","2.2.5-r1","2.2.5-r2","2.3.0-r0"],"ecosystem_specific":{},"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-40145.json"}},{"package":{"name":"gd","ecosystem":"Alpine:v3.23","purl":"pkg:apk/alpine/gd?arch=source"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.0-r1"}]}],"versions":["2.0.35-r0","2.0.35-r1","2.0.35-r2","2.0.36_rc1-r0","2.0.36_rc1-r1","2.0.36_rc1-r2","2.0.36_rc1-r3","2.0.36_rc1-r4","2.0.36_rc1-r5","2.0.36_rc1-r6","2.0.36_rc1-r7","2.0.36_rc1-r8","2.0.36_rc1-r9","2.1.0-r0","2.1.0-r1","2.1.1-r0","2.2.1-r0","2.2.3-r0","2.2.3-r1","2.2.4-r0","2.2.4-r1","2.2.4-r2","2.2.5-r0","2.2.5-r1","2.2.5-r2","2.3.0-r0"],"ecosystem_specific":{},"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2021-40145.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}