CVE-2017-13144
Medium · 6.5CVSS
6.5
EPSS
2.0%
Published
Aug 23, 2017
CISA due date
—
Cloudanix analysis
A flaw in image processing software can make programs that handle pictures crash when given specially crafted files, potentially interrupting services that rely on those programs.
- 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
The mpc image coder in ImageMagick fails to validate image dimensions before allocation, resulting in an unhandled crash instead of returning a proper width/height limit error when dimensions exceed internal limits.
Why it matters to the business
Applications that process user-supplied images can be forced offline or into repeated restarts, disrupting services that rely on ImageMagick for format conversion or thumbnail generation.
How an attack unfolds
An attacker crafts a small MPC file header declaring extremely large width and height values, then supplies it to any ImageMagick-based workflow; the library attempts to process the dimensions and crashes rather than gracefully rejecting the input.
How to fix it
Upgrade ImageMagick to version 6.9.7-10 or newer; rebuild any dependent packages against the patched library; consider disabling the mpc coder in policy.xml if immediate upgrade is not feasible.
How to confirm the fix worked
Run identify or convert against a test MPC file with dimensions exceeding 100000x100000 and confirm the command exits with a width/height limit error rather than a segmentation fault or abort.
Typical attack path
- Attacker generates a minimal MPC image file containing oversized dimension fields
- File is delivered to the target via upload, URL fetch, or email attachment
- Target application invokes ImageMagick (e.g., convert, identify) on the file
- Library dereferences invalid allocation sizes and terminates
- Service becomes unavailable until restarted or until the process pool is exhausted
How to detect it
Search application and system logs for ImageMagick processes terminating abnormally when handling MPC files; look for repeated segfault or abort entries correlated with image upload or conversion timestamps.
- ImageMagick abort on mpc coder
- width or height exceeds limit
- convert: abort due to signal
- identify: magick/constitute.c
What your security team should do
- Prioritize upgrade of all ImageMagick installations to 6.9.7-10 or later within standard change windows
- Add the oversized-dimension MPC test case to automated regression suites for image-processing pipelines
- Review and tighten ImageMagick security policy to limit resource usage and disable unused coders
- Monitor process crash rates for ImageMagick binaries in production logs
The record
In ImageMagick before 6.9.7-10, there is a crash (rather than a "width or height exceeds limit" error report) if the image dimensions are too large, as demonstrated by use of the mpc coder.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | imagemagick | 0 | 8:6.9.7.4+dfsg-13 |
| Debian:12 | imagemagick | 0 | 8:6.9.7.4+dfsg-13 |
| Debian:13 | imagemagick | 0 | 8:6.9.7.4+dfsg-13 |
| Debian:7 | imagemagick | 0 | 8:6.7.7.10-5+deb7u16 |
| Debian:8 | imagemagick | 0 | 8:6.8.9.9-5+deb8u11 |
| Debian:9 | imagemagick | 0 | 8:6.9.7.4+dfsg-11+deb9u2 |
| Mageia:6 | converseen | 0 | 0.9.6.2-1.3.mga6 |
| Mageia:6 | cuneiform-linux | 0 | 1.1.0-9.2.mga6 |
| Mageia:6 | dvdauthor | 0 | 0.7.2-2.2.mga6 |
| Mageia:6 | emacs | 0 | 24.5-8.3.mga6 |
| Mageia:6 | imagemagick | 0 | 6.9.9.41-1.mga6 |
| Mageia:6 | inkscape | 0 | 0.92.1-2.2.mga6 |
| Mageia:6 | k3d | 0 | 0.8.0.5-5.2.mga6 |
| Mageia:6 | kxstitch | 0 | 2.0.0-2.2.mga6 |
| Mageia:6 | libopenshot | 0 | 0.1.8-1.2.mga6 |
| Mageia:6 | ocaml-glmlite | 0 | 0.03.51-17.2.mga6 |
| Mageia:6 | perl-Image-SubImageFind | 0 | 0.30.0-6.2.mga6 |
| Mageia:6 | pfstools | 0 | 2.0.6-3.2.mga6 |
| Mageia:6 | php-imagick | 0 | 3.4.1-6.2.mga6 |
| Mageia:6 | php-magickwand | 0 | 1.0.9.2-10.2.mga6 |
| Mageia:6 | psiconv | 0 | 0.9.8-26.2.mga6 |
| Mageia:6 | pythonmagick | 0 | 0.9.12-7.2.mga6 |
| Mageia:6 | ruby-rmagick | 0 | 2.15.4-12.2.mga6 |
| Mageia:6 | synfig | 0 | 1.2.1-2.2.mga6 |
| Mageia:6 | vdr-plugin-skinelchi | 0 | 0.2.8-8.2.mga6 |
| Mageia:6 | vdr-plugin-skinenigmang | 0 | 0.1.2-10.2.mga6 |
| Ubuntu:14.04:LTS | imagemagick | 0 | 8:6.7.7.10-6ubuntu3.11 |
| Ubuntu:16.04:LTS | imagemagick | 0 | 8:6.8.9.9-7ubuntu5.11 |
| Ubuntu:18.04:LTS | imagemagick | 0 | 8:6.9.7.4+dfsg-16ubuntu2 |
| Ubuntu:18.04:LTS | imagemagick | 0 | 8:6.9.7.4+dfsg-16ubuntu6.2 |
| Ubuntu:Pro:14.04:LTS | imagemagick | 0 | No fix |
| Ubuntu:Pro:14.04:LTS | imagemagick | 0 | 8:6.7.7.10-6ubuntu3.13+esm8 |
| Ubuntu:Pro:16.04:LTS | imagemagick | 0 | 8:6.8.9.9-7ubuntu5.16+esm2 |
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-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-2017-6498 An issue was discovered in ImageMagick 6.9.7. Also affects imagemagick
- CVE-2016-10062 The ReadGROUP4Image function in coders/tiff.c in ImageMagick does not check the return… Also affects imagemagick