CVE-2026-77118Out-of-bounds write in GraphicsMagick PCD decoder
A heap out-of-bounds write exists in the Photo CD (PCD) decoder of GraphicsMagick. In DecodeImage() (coders/pcd.c), the Huffman delta loop advances its output pointer with q++ after every decoded delta and never checks it against the end of the heap-allocated luma/chroma plane buffers. The pointer is repositioned only when a sync marker introduces a new plane/row; between sync markers the run length is bounded solely by the input. A crafted PCD file that positions the pointer near the end of a plane and then supplies a long run of deltas with no intervening sync therefore walks the pointer past the end of the allocation and writes through it. Processing an untrusted PCD file — for example with gm convert or gm identify, or through any application linked against libGraphicsMagick — can corrupt heap memory beyond the buffers.
What to do
Fixed builds are available from Debian: see the table below for the fixed version per release.
Debian, Ubuntu have 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
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.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | graphicsmagick | Under investigation | UBUNTU-CVE-2026-77118 | |
| Ubuntu 24.04 | graphicsmagick | Fix pending | UBUNTU-CVE-2026-77118 | |
| Ubuntu 22.04 | graphicsmagick | Fix pending | UBUNTU-CVE-2026-77118 | |
| Ubuntu 20.04 | graphicsmagick | Fix pending | UBUNTU-CVE-2026-77118 | |
| Ubuntu 18.04 | graphicsmagick | Fix pending | UBUNTU-CVE-2026-77118 | |
| Ubuntu 16.04 | graphicsmagick | Fix pending | UBUNTU-CVE-2026-77118 | |
| Ubuntu 14.04 | graphicsmagick | Fix pending | UBUNTU-CVE-2026-77118 | |
| Debian 14 | graphicsmagick | Fixed | 1.4+really1.3.48-1 | DEBIAN-CVE-2026-77118 |
| Debian 13 | graphicsmagick | Fix pending | DEBIAN-CVE-2026-77118 | |
| Debian 12 | graphicsmagick | Fix pending | DEBIAN-CVE-2026-77118 |
What the vendor says
As published in the CVE record by seal, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- GraphicsMagick Group GraphicsMagick: affected: 1.0.0 to before 1.3.48; fixed in
1.3.48 - Debian graphicsmagick: affected: before 1.4+really1.3.48-1; fixed in
1.4+really1.3.48-1 - Fedora Project GraphicsMagick: affected: before 1.3.48; fixed in
1.3.48
Solution: Upgrade to GraphicsMagick 1.3.48 or later, which bounds the decode output pointer against the end of each plane buffer and over-provisions the buffers.
Workaround: Where upgrading is not possible, prevent the PCD and PCDS coders from being used on untrusted input. GraphicsMagick detects PCD by file content, so filtering on filename extension is not sufficient; the coder module must be removed or the format rejected before decoding.
Vendor advisories:
- https://foss.heptapod.net/graphicsmagick/graphicsmagick/-/commit/937cdd9920bd96 (patch)
- https://foss.heptapod.net/graphicsmagick/graphicsmagick/-/raw/GraphicsMagick-1_3_48/Chang… (release-notes)
References
- https://foss.heptapod.net/graphicsmagick/graphicsmagick/-/commit/937cdd9920bd96
- https://foss.heptapod.net/graphicsmagick/graphicsmagick/-/raw/GraphicsMagick-1_3_48/ChangeLog
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.