{"id":"UBUNTU-CVE-2026-77118","details":"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.","modified":"2026-09-02T19:36:50.035548775Z","published":"2026-08-20T13:19:00Z","upstream":["CVE-2026-77118"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2026-77118"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2026-77118"}],"affected":[{"package":{"name":"graphicsmagick","ecosystem":"Ubuntu:Pro:14.04:LTS","purl":"pkg:deb/ubuntu/graphicsmagick?arch=source&distro=esm-infra-legacy%2Ftrusty"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.3.16-1.1ubuntu2","1.3.16-1.1ubuntu3","1.3.18-1ubuntu3","1.3.18-1ubuntu3.1","1.3.18-1ubuntu3.1+esm1","1.3.18-1ubuntu3.1+esm2","1.3.18-1ubuntu3.1+esm3","1.3.18-1ubuntu3.1+esm4","1.3.18-1ubuntu3.1+esm5","1.3.18-1ubuntu3.1+esm6","1.3.18-1ubuntu3.1+esm7","1.3.18-1ubuntu3.1+esm8"],"ecosystem_specific":{"binaries":[{"binary_name":"graphicsmagick","binary_version":"1.3.18-1ubuntu3.1+esm8"},{"binary_version":"1.3.18-1ubuntu3.1+esm8","binary_name":"graphicsmagick-imagemagick-compat"},{"binary_version":"1.3.18-1ubuntu3.1+esm8","binary_name":"graphicsmagick-libmagick-dev-compat"},{"binary_version":"1.3.18-1ubuntu3.1+esm8","binary_name":"libgraphics-magick-perl"},{"binary_name":"libgraphicsmagick++3","binary_version":"1.3.18-1ubuntu3.1+esm8"},{"binary_name":"libgraphicsmagick3","binary_version":"1.3.18-1ubuntu3.1+esm8"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-77118.json"}},{"package":{"name":"graphicsmagick","ecosystem":"Ubuntu:Pro:16.04:LTS","purl":"pkg:deb/ubuntu/graphicsmagick?arch=source&distro=esm-apps%2Fxenial"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.3.21-3","1.3.23-1","1.3.23-1build1","1.3.23-1ubuntu0.1","1.3.23-1ubuntu0.1+esm1","1.3.23-1ubuntu0.2","1.3.23-1ubuntu0.3","1.3.23-1ubuntu0.4","1.3.23-1ubuntu0.5","1.3.23-1ubuntu0.6","1.3.23-1ubuntu0.6+esm1","1.3.23-1ubuntu0.6+esm2"],"ecosystem_specific":{"binaries":[{"binary_name":"graphicsmagick","binary_version":"1.3.23-1ubuntu0.6+esm2"},{"binary_version":"1.3.23-1ubuntu0.6+esm2","binary_name":"graphicsmagick-imagemagick-compat"},{"binary_name":"graphicsmagick-libmagick-dev-compat","binary_version":"1.3.23-1ubuntu0.6+esm2"},{"binary_name":"libgraphics-magick-perl","binary_version":"1.3.23-1ubuntu0.6+esm2"},{"binary_name":"libgraphicsmagick++-q16-12","binary_version":"1.3.23-1ubuntu0.6+esm2"},{"binary_version":"1.3.23-1ubuntu0.6+esm2","binary_name":"libgraphicsmagick-q16-3"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-77118.json"}},{"package":{"name":"graphicsmagick","ecosystem":"Ubuntu:Pro:18.04:LTS","purl":"pkg:deb/ubuntu/graphicsmagick?arch=source&distro=esm-apps%2Fbionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.3.26-15","1.3.26-16","1.3.26-19","1.3.27-1","1.3.27-2","1.3.27-3","1.3.28-1","1.3.28-2","1.3.28-2ubuntu0.1","1.3.28-2ubuntu0.1+esm1","1.3.28-2ubuntu0.2","1.3.28-2ubuntu0.2+esm1"],"ecosystem_specific":{"binaries":[{"binary_version":"1.3.28-2ubuntu0.2+esm1","binary_name":"graphicsmagick"},{"binary_name":"graphicsmagick-imagemagick-compat","binary_version":"1.3.28-2ubuntu0.2+esm1"},{"binary_name":"graphicsmagick-libmagick-dev-compat","binary_version":"1.3.28-2ubuntu0.2+esm1"},{"binary_name":"libgraphics-magick-perl","binary_version":"1.3.28-2ubuntu0.2+esm1"},{"binary_version":"1.3.28-2ubuntu0.2+esm1","binary_name":"libgraphicsmagick++-q16-12"},{"binary_version":"1.3.28-2ubuntu0.2+esm1","binary_name":"libgraphicsmagick-q16-3"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-77118.json"}},{"package":{"name":"graphicsmagick","ecosystem":"Ubuntu:Pro:20.04:LTS","purl":"pkg:deb/ubuntu/graphicsmagick?arch=source&distro=esm-apps%2Ffocal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.4+really1.3.33+hg16115-1","1.4+really1.3.33+hg16115-1build1","1.4+really1.3.33+hg16117-1","1.4+really1.3.34-1","1.4+really1.3.34-2","1.4+really1.3.34+hg16181-1","1.4+really1.3.35-1","1.4+really1.3.35-1ubuntu0.1~esm1","1.4+really1.3.35-1ubuntu0.1"],"ecosystem_specific":{"binaries":[{"binary_name":"graphicsmagick","binary_version":"1.4+really1.3.35-1ubuntu0.1"},{"binary_name":"graphicsmagick-imagemagick-compat","binary_version":"1.4+really1.3.35-1ubuntu0.1"},{"binary_name":"graphicsmagick-libmagick-dev-compat","binary_version":"1.4+really1.3.35-1ubuntu0.1"},{"binary_name":"libgraphics-magick-perl","binary_version":"1.4+really1.3.35-1ubuntu0.1"},{"binary_name":"libgraphicsmagick++-q16-12","binary_version":"1.4+really1.3.35-1ubuntu0.1"},{"binary_name":"libgraphicsmagick-q16-3","binary_version":"1.4+really1.3.35-1ubuntu0.1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-77118.json"}},{"package":{"name":"graphicsmagick","ecosystem":"Ubuntu:Pro:22.04:LTS","purl":"pkg:deb/ubuntu/graphicsmagick?arch=source&distro=esm-apps%2Fjammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.4+really1.3.36+hg16481-2","1.4+really1.3.37-1","1.4+really1.3.37-1build1","1.4+really1.3.37+hg16662-1ubuntu1","1.4+really1.3.38-1","1.4+really1.3.38-1ubuntu0.1","1.4+really1.3.38-1ubuntu0.1+esm1"],"ecosystem_specific":{"binaries":[{"binary_version":"1.4+really1.3.38-1ubuntu0.1+esm1","binary_name":"graphicsmagick"},{"binary_name":"graphicsmagick-imagemagick-compat","binary_version":"1.4+really1.3.38-1ubuntu0.1+esm1"},{"binary_name":"graphicsmagick-libmagick-dev-compat","binary_version":"1.4+really1.3.38-1ubuntu0.1+esm1"},{"binary_version":"1.4+really1.3.38-1ubuntu0.1+esm1","binary_name":"libgraphics-magick-perl"},{"binary_name":"libgraphicsmagick++-q16-12","binary_version":"1.4+really1.3.38-1ubuntu0.1+esm1"},{"binary_name":"libgraphicsmagick-q16-3","binary_version":"1.4+really1.3.38-1ubuntu0.1+esm1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-77118.json"}},{"package":{"name":"graphicsmagick","ecosystem":"Ubuntu:Pro:24.04:LTS","purl":"pkg:deb/ubuntu/graphicsmagick?arch=source&distro=esm-apps%2Fnoble"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.4+really1.3.42-1","1.4+really1.3.42-1build1","1.4+really1.3.42-1.1build1","1.4+really1.3.42-1.1build2","1.4+really1.3.42-1.1build3","1.4+really1.3.42-1.1ubuntu0.1~esm1"],"ecosystem_specific":{"binaries":[{"binary_name":"graphicsmagick","binary_version":"1.4+really1.3.42-1.1ubuntu0.1~esm1"},{"binary_version":"1.4+really1.3.42-1.1ubuntu0.1~esm1","binary_name":"graphicsmagick-imagemagick-compat"},{"binary_version":"1.4+really1.3.42-1.1ubuntu0.1~esm1","binary_name":"graphicsmagick-libmagick-dev-compat"},{"binary_version":"1.4+really1.3.42-1.1ubuntu0.1~esm1","binary_name":"libgraphics-magick-perl"},{"binary_name":"libgraphicsmagick++-q16-12t64","binary_version":"1.4+really1.3.42-1.1ubuntu0.1~esm1"},{"binary_name":"libgraphicsmagick-q16-3t64","binary_version":"1.4+really1.3.42-1.1ubuntu0.1~esm1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-77118.json"}},{"package":{"name":"graphicsmagick","ecosystem":"Ubuntu:26.04:LTS","purl":"pkg:deb/ubuntu/graphicsmagick?arch=source&distro=resolute"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.4+really1.3.45+hg17696-1build1","1.4+really1.3.46-2"],"ecosystem_specific":{"binaries":[{"binary_name":"graphicsmagick","binary_version":"1.4+really1.3.46-2"},{"binary_name":"libgraphics-magick-perl","binary_version":"1.4+really1.3.46-2"},{"binary_name":"libgraphicsmagick++-q16-12t64","binary_version":"1.4+really1.3.46-2"},{"binary_name":"libgraphicsmagick-q16-3t64","binary_version":"1.4+really1.3.46-2"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-77118.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"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"},{"type":"Ubuntu","score":"medium"}]}