CVE-2017-14165
Medium · 6.5CVSS
6.5
EPSS
2.3%
Published
Sep 6, 2017
CISA due date
—
Cloudanix analysis
A problem in image-handling software can let attackers crash programs by sending a specially made picture file, which may stop services that read or check images from working.
- 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
Excessive memory allocation in ReadSUNImage driven solely by an untrusted length field in the SUN image header, causing MagickMalloc to exhaust resources and trigger remote denial of service.
Why it matters to the business
Services that scan or convert images can be forced offline or slowed dramatically when they encounter a malicious file, interrupting security scanning pipelines and image-processing workflows.
How an attack unfolds
An attacker creates a SUN image whose header length field is set to a huge value, delivers the file to any application using the vulnerable GraphicsMagick library for parsing, and the library allocates far more memory than needed, crashing the process.
How to fix it
Upgrade harbor-scanner-trivy (Chainguard) to 0.31.2-r2 or later and harbor-scanner-trivy (Wolfi) to 0.31.2-r2 or later; alternatively update the underlying GraphicsMagick package to a version that bounds header-driven allocations.
How to confirm the fix worked
Confirm the installed package versions match or exceed the listed fixed releases; reprocess a set of known-good and boundary-case SUN images and verify memory usage remains within expected limits.
Typical attack path
- Craft a SUN raster image containing an oversized header length field
- Deliver the image to the target via file upload, download, or email attachment
- Trigger image parsing through GraphicsMagick's ReadSUNImage function
- Observe memory exhaustion and service denial
How to detect it
Review application and system logs for GraphicsMagick memory-allocation failures or abrupt process termination while handling SUN or other image formats; correlate spikes in memory usage with recent image-processing events.
What your security team should do
- Apply the specified package upgrades across all affected scanner deployments without delay
- Isolate image-processing workloads in resource-limited containers or sandboxes
- Add file-type and size validation before invoking GraphicsMagick on untrusted input
The record
The ReadSUNImage function in coders/sun.c in GraphicsMagick 1.3.26 has an issue where memory allocation is excessive because it depends only on a length field in a header. This may lead to remote denial of service in the MagickMalloc function in magick/memory.c.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:10 | graphicsmagick | 0 | 1.3.26-9 |
| Debian:11 | graphicsmagick | 0 | 1.3.26-9 |
| Debian:12 | graphicsmagick | 0 | 1.3.26-9 |
| Debian:13 | graphicsmagick | 0 | 1.3.26-9 |
| SUSE:Linux Enterprise Software Development Kit 11 SP4 | GraphicsMagick | 0 | 1.2.5-4.78.19.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.4 |
| Ubuntu:Pro:14.04:LTS | graphicsmagick | 0 | 1.3.18-1ubuntu3.1+esm4 |
Related vulnerabilities
- 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-2006-4144 Integer overflow in the ReadSGIImage function in sgi.c in ImageMagick before 6.2.9 allows… Also affects graphicsmagick
- CVE-2025-27796 ReadWPGImage in WPG in GraphicsMagick before 1.3.46 mishandles palette buffer allocation… 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-16545 The ReadWPGImage function in coders/wpg.c in GraphicsMagick 1.3.26 does not properly… Also affects graphicsmagick
- CVE-2017-16352 GraphicsMagick 1.3.26 is vulnerable to a heap-based buffer overflow vulnerability found… Also affects graphicsmagick