CVE-2017-16545
High · 8.8CVSS
8.8
EPSS
2.2%
Published
Nov 5, 2017
CISA due date
—
Cloudanix analysis
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
- Create a specially crafted WPG image file containing invalid colormap data
- Deliver the file to the victim through web upload, email attachment, or file share
- Victim application invokes GraphicsMagick to read the WPG image
- 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
- CVE-2025-27796 ReadWPGImage in WPG in GraphicsMagick before 1.3.46 mishandles palette buffer allocation… Also affects graphicsmagick
- CVE-2022-1270 In GraphicsMagick, a heap buffer overflow was found when parsing MIFF. Also affects graphicsmagick
- CVE-2019-12921 In GraphicsMagick before 1.3.32, the text filename component allows remote attackers to… Also affects graphicsmagick
- CVE-2018-20184 In GraphicsMagick 1.4 snapshot-20181209 Q8, there is a heap-based buffer overflow in the… Also affects graphicsmagick
- CVE-2017-17912 In GraphicsMagick 1.4 snapshot-20171217 Q8, there is a heap-based buffer over-read in… Also affects graphicsmagick
- CVE-2017-16352 GraphicsMagick 1.3.26 is vulnerable to a heap-based buffer overflow vulnerability found… Also affects graphicsmagick
- CVE-2017-16353 GraphicsMagick 1.3.26 is vulnerable to a memory information disclosure vulnerability… Also affects graphicsmagick
- CVE-2017-15277 ReadGIFImage in coders/gif.c in ImageMagick 7.0.6-1 and GraphicsMagick 1.3.26 leaves the… Also affects graphicsmagick