8.4high
Out-of-bounds write in GraphicsMagick PCD decoder
- Severity
- 8.4high CVSS:4.0 by seal
- Exploit likelihood
- 0.13% (higher than 2% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- seal
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| GraphicsMagick Group GraphicsMagick | from 1.0.0 before 1.3.48 | CVE List |
| graphicsmagick | before 1.4+really1.3.48-1, before 1.3.48 | CVE List |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
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.
NVD (es)
Existe una escritura fuera de límites en el heap en el decodificador de Photo CD (PCD) de GraphicsMagick. En DecodeImage() (coders/pcd.c), el bucle de delta de Huffman avanza su puntero de salida con q++ después de cada delta decodificado y nunca lo verifica contra el final de los búferes de plano de luma/croma asignados en el heap. El puntero se reposiciona solo cuando un marcador de sincronización introduce un nuevo plano/fila; entre marcadores de sincronización, la longitud de la ejecución está limitada únicamente por la entrada. Un archivo PCD manipulado que posiciona el puntero cerca del final de un plano y luego suministra una larga secuencia de deltas sin sincronización intermedia, por lo tanto, mueve el puntero más allá del final de la asignación y escribe a través de él. Procesar un archivo PCD no confiable - por ejemplo, con gm convert o gm identify, o a través de cualquier aplicación enlazada con libGraphicsMagick - puede corromper la memoria del heap más allá de los búferes.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-77118 changed 2026-08-26 | CVE Terms of Use |
| NVD | CVE-2026-77118 changed 2026-10-27 | Public domain |