CVE-2017-6498
Medium · 5.5CVSS
5.5
EPSS
1.3%
Published
Mar 6, 2017
CISA due date
—
Cloudanix analysis
A flaw in widely used image software lets attackers crash programs simply by providing a specially crafted image file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Application
- Class
- Improper Input Validation
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Malformed TGA image files trigger assertion failures inside ImageMagick's TGA decoder, causing the process to terminate.
Why it matters to the business
Applications that rely on ImageMagick for image handling can be forced offline or slowed when they receive crafted TGA files, interrupting workflows that process user-supplied images.
How an attack unfolds
An attacker creates a TGA file that violates the format expectations of the decoder, then causes the target application to open or convert that file; the resulting assertion aborts the ImageMagick process and produces a denial of service.
How to fix it
Upgrade ImageMagick to a build that includes commit 65f75a32a93ae4044c528a987a68366ecd4b46b9 or later; rebuild any dependent packages against the updated library and restart affected services.
How to confirm the fix worked
Confirm the installed ImageMagick version or commit hash contains the fix; re-test with a set of known-malformed TGA samples to verify assertions no longer fire.
Typical attack path
- Craft a TGA file containing invalid header or data values that trigger an assertion
- Deliver the file to an application that invokes ImageMagick for thumbnail generation, conversion, or validation
- Trigger image processing of the supplied file
- Observe process crash or service unavailability
How to detect it
Monitor process logs and crash dumps for ImageMagick assertion failures or abrupt terminations when TGA files are processed; inspect web or application logs for recent receipt of TGA files immediately preceding outages.
What your security team should do
- Apply the fixed commit or newer release to all ImageMagick installations within 30 days
- Inventory and update downstream packages that statically link or bundle ImageMagick
- Add input-size and format-validation checks in front of ImageMagick calls until patching is complete
The record
An issue was discovered in ImageMagick 6.9.7. Incorrect TGA files could trigger assertion failures, thus leading to DoS.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | imagemagick | 0 | 8:6.9.7.4+dfsg-2 |
| Debian:12 | imagemagick | 0 | 8:6.9.7.4+dfsg-2 |
| Debian:13 | imagemagick | 0 | 8:6.9.7.4+dfsg-2 |
| Debian:7 | imagemagick | 0 | 8:6.7.7.10-5+deb7u12 |
| Debian:8 | imagemagick | 0 | 8:6.8.9.9-5+deb8u8 |
| Ubuntu:14.04:LTS | imagemagick | 0 | 8:6.7.7.10-6ubuntu3.6 |
| Ubuntu:16.04:LTS | imagemagick | 0 | 8:6.8.9.9-7ubuntu5.6 |
Related vulnerabilities
- CVE-2014-2030 Stack-based buffer overflow in the WritePSDImage function in coders/psd.c in ImageMagick… Also affects imagemagick
- CVE-2017-15277 ReadGIFImage in coders/gif.c in ImageMagick 7.0.6-1 and GraphicsMagick 1.3.26 leaves the… Also affects imagemagick
- CVE-2017-14528 The TIFFSetProfiles function in coders/tiff.c in ImageMagick 7.0.6 has incorrect… Also affects imagemagick
- CVE-2017-13144 In ImageMagick before 6.9.7-10, there is a crash (rather than a "width or height exceeds… Also affects imagemagick
- CVE-2017-10928 In ImageMagick 7.0.6-0, a heap-based buffer over-read in the GetNextToken function in… Also affects imagemagick
- CVE-2014-8354 The HorizontalFilter function in resize.c in ImageMagick before 6.8.9-9 allows remote… Also affects imagemagick
- CVE-2017-7606 coders/rle.c in ImageMagick 7.0.5-4 has an "outside the range of representable values of… Also affects imagemagick
- CVE-2016-10062 The ReadGROUP4Image function in coders/tiff.c in ImageMagick does not check the return… Also affects imagemagick