Description
GD versions before 2.86 for Perl allow OS command injection and file overwrite via a 2-arg open() of filename arguments in _make_filehandle.
GD::Image::_make_filehandle opens a filename argument with Perl's 2-arg open(), so a filename that begins or ends with a pipe ("| cmd", "cmd |") or begins with a redirect ("> path", ">> path") is run as a command or redirect rather than opened as a file. _make_filehandle is the single open path behind every filename-accepting constructor (new, newFromPng, newFromJpeg, and the rest); the in-memory *Data variants do not open a path and are unaffected.
Any caller that forwards untrusted input to one of these constructors as a pathname can run an arbitrary command or truncate a file under the process UID.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| RURBAN | GD | < 2.86 | 2.86 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | libgd-perl | 2.84-3 | — |
| Debian 13 | libgd-perl | 2.78-1+deb13u1 | — |
| Debian 12 | libgd-perl | 2.76-4+deb12u1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.04 LTS | libgd-perl | 2.84-2ubuntu0.1 | USN-8484-1 |
| Ubuntu 25.10 | libgd-perl | 2.78-1ubuntu0.25.10.1 | USN-8484-1 |
| Ubuntu 24.04 LTS | libgd-perl | 2.78-1ubuntu0.24.04.1 | USN-8484-1 |
| Ubuntu 22.04 LTS | libgd-perl | 2.76-2ubuntu0.1 | USN-8484-1 |
| Ubuntu 20.04 LTS | libgd-perl | No fix yet | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 18.04 LTS | libgd-perl | No fix yet | — |
| Ubuntu 16.04 LTS | libgd-perl | No fix yet | — |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 7 ELS | perl-GD | 2.49-3.el7_9.1 | RHSA-2026:49758 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | perl-GD | 2.860.0-1.1 | openSUSE-SU-2026:11017-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | perl-gd | 2.86-r0 | — |
| Alpine v3.23 | perl-gd | 2.86-r0 | — |
| Alpine v3.22 | perl-gd | 2.86-r0 | — |
| Alpine v3.21 | perl-gd | 2.86-r0 | — |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | perl-GD | 2.80-1.amzn2023.0.3 | ALAS2023-2026-1890 |
| Amazon Linux 2 | perl-GD | 2.49-3.amzn2.0.3 | ALAS2-2026-3387 |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 7 | perl-GD | 2.49-3.0.1.el7 | ELSA-2026-49758 |
Advisories 7
- WID-SEC-2026-2630 Red Hat Enterprise Linux (DBI, perl-GD): Mehrere Schwachstellen BSI CERT-Bund (WID) · Oct 25, 2026
- ELSA-2026-49758 Critical: perl-GD security update (Oracle Linux 7) Oracle Linux Security Advisories (ELSA) · Sep 3, 2026
- RHSA-2026:49758 Red Hat Security Advisory: perl-GD security update Red Hat Security Advisories (RHSA) · Aug 4, 2026
- USN-8484-1 libgd-perl vulnerability Ubuntu Security Notices (USN) · Jun 30, 2026
- ALAS2-2026-3387 Important: perl-GD security update (Amazon Linux 2) Amazon Linux Security Center (ALAS) · Jun 22, 2026
- ALAS2023-2026-1890 Important: perl-GD security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Jun 22, 2026
- openSUSE-SU-2026:11017-1 perl-GD-2.860.0-1.1 on GA media SUSE / openSUSE Security Updates · Jun 13, 2026