Out-of-bounds write in GraphicsMagick PCD decoder
Summary
| CVE | CVE-2026-77118 |
|---|---|
| State | PUBLISHED |
| Assigner | seal |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-08-20 13:19:07 UTC |
| Updated | 2026-08-20 13:19:07 UTC |
| Description | 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. |
Risk And Classification
Primary CVSS: v4.0 8.4 HIGH from 22e2d327-25fe-45d7-9f0c-dcd23b7108df
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
EPSS: 0.001310000 probability, percentile 0.031330000 (date 2026-08-21)
Problem Types: CWE-787 | CWE-787 CWE-787 Out-of-bounds write
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 4.0 | 22e2d327-25fe-45d7-9f0c-dcd23b7108df | Secondary | 8.4 | HIGH | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/C... |
| 4.0 | CNA | CVSS | 8.4 | HIGH | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
CVSS v4.0 Breakdown
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|---|---|---|---|
| CNA | GraphicsMagick Group | GraphicsMagick | affected 1.0.0 1.3.48 semver | Linux, Windows, macOS |
| CNA | Debian | Graphicsmagick | affected 1.4+really1.3.48-1 deb | Not specified |
| CNA | Fedora Project | GraphicsMagick | affected 1.3.48 rpm | Not specified |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| foss.heptapod.net/graphicsmagick/graphicsmagick/-/raw/GraphicsMagick-1_3_48/Cha... | 22e2d327-25fe-45d7-9f0c-dcd23b7108df | foss.heptapod.net | |
| foss.heptapod.net/graphicsmagick/graphicsmagick/-/commit/937cdd9920bd96 | 22e2d327-25fe-45d7-9f0c-dcd23b7108df | foss.heptapod.net | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
Vendor Comments And Credit
Discovery Credit
CNA: Cipher - Causal Security (https://causalsecurity.com/), who discovered the defect and reported it to the GraphicsMagick maintainer on 2026-06-14 (en)
CNA: Bob Friesenhahn, GraphicsMagick, for the upstream fix (en)
Additional Advisory Data
Solutions
CNA: 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.
Workarounds
CNA: 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.