Cloudanix VulnDB

CVE-2017-16545

High · 8.8

CVSS

8.8

EPSS

2.2%

Published

Nov 5, 2017

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A bug in widely used image software can make programs crash or behave oddly when they try to open certain specially crafted picture files.

Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Low
Impact
Denial Of Service
Component
Library
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The ReadWPGImage function in coders/wpg.c fails to validate colormapped WPG images, resulting in an invalid write via ImportIndexQuantumType that can crash the application or enable further memory corruption.

Why it matters to the business

Services relying on GraphicsMagick for image handling may experience sudden crashes or instability when encountering crafted WPG files, leading to operational disruptions and potential downtime for image-processing workflows.

How an attack unfolds

An attacker creates a malformed WPG image that bypasses colormap validation, then supplies the file to a target system where GraphicsMagick attempts to process it, triggering the invalid memory write.

How to fix it

Upgrade GraphicsMagick to a version that contains the fix for improper WPG colormap validation; if no fixed release is available, disable WPG support or restrict image processing to trusted sources.

How to confirm the fix worked

Confirm GraphicsMagick version is newer than 1.3.26, test processing of both benign and known-malformed WPG files to verify absence of crashes, and review source code or release notes for the validation fix.

Typical attack path

  1. Create a specially crafted WPG image file containing invalid colormap data
  2. Deliver the file to the victim through web upload, email attachment, or file share
  3. Victim application invokes GraphicsMagick to read the WPG image
  4. ReadWPGImage performs an out-of-bounds write and crashes or corrupts memory

How to detect it

Search application and system logs for GraphicsMagick crashes or segmentation faults occurring during WPG file processing; inspect core dumps or stack traces referencing ReadWPGImage or ImportIndexQuantumType.

What your security team should do

  • Immediately upgrade GraphicsMagick to the latest available release
  • Implement input validation or sandboxing around image-processing functions
  • Block or quarantine WPG files from untrusted sources until patched
  • Monitor application logs and crash reports for WPG-related failures

The record

The ReadWPGImage function in coders/wpg.c in GraphicsMagick 1.3.26 does not properly validate colormapped images, which allows remote attackers to cause a denial of service (ImportIndexQuantumType invalid write and application crash) or possibly have unspecified other impact via a malformed WPG image.

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 graphicsmagick 0 1.3.26-18
Debian:12 graphicsmagick 0 1.3.26-18
Debian:13 graphicsmagick 0 1.3.26-18
Debian:9 graphicsmagick 0 1.3.30+hg15796-1~deb9u1
SUSE:Linux Enterprise Desktop 12 SP2 ImageMagick 0 6.8.8.1-71.17.1
SUSE:Linux Enterprise Desktop 12 SP3 ImageMagick 0 6.8.8.1-71.17.1
SUSE:Linux Enterprise Server 11 SP4 ImageMagick 0 6.4.3.6-7.78.14.1
SUSE:Linux Enterprise Server 12 SP2 ImageMagick 0 6.8.8.1-71.17.1
SUSE:Linux Enterprise Server 12 SP3 ImageMagick 0 6.8.8.1-71.17.1
SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 ImageMagick 0 6.8.8.1-71.17.1
SUSE:Linux Enterprise Server for SAP Applications 11 SP4 ImageMagick 0 6.4.3.6-7.78.14.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP2 ImageMagick 0 6.8.8.1-71.17.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP3 ImageMagick 0 6.8.8.1-71.17.1
SUSE:Linux Enterprise Software Development Kit 11 SP4 GraphicsMagick 0 1.2.5-4.78.19.1
SUSE:Linux Enterprise Software Development Kit 11 SP4 ImageMagick 0 6.4.3.6-7.78.14.1
SUSE:Linux Enterprise Software Development Kit 12 SP2 ImageMagick 0 6.8.8.1-71.17.1
SUSE:Linux Enterprise Software Development Kit 12 SP3 ImageMagick 0 6.8.8.1-71.17.1
SUSE:Linux Enterprise Workstation Extension 12 SP2 ImageMagick 0 6.8.8.1-71.17.1
SUSE:Linux Enterprise Workstation Extension 12 SP3 ImageMagick 0 6.8.8.1-71.17.1
SUSE:Studio Onsite 1.3 GraphicsMagick 0 1.2.5-4.78.19.1
Ubuntu:16.04:LTS graphicsmagick 0 1.3.23-1ubuntu0.5
Ubuntu:Pro:14.04:LTS graphicsmagick 0 1.3.18-1ubuntu3.1+esm5

Related vulnerabilities