CVE-2019-13135
📋 TL;DR
This vulnerability in ImageMagick's CUT image decoder allows attackers to trigger a use of uninitialized value, potentially leading to memory corruption, crashes, or arbitrary code execution. It affects any system using vulnerable versions of ImageMagick to process CUT image files. The vulnerability is particularly dangerous in web applications that allow image uploads.
💻 Affected Systems
- ImageMagick
📦 What is this software?
Big Ip Application Acceleration Manager by F5
View all CVEs affecting Big Ip Application Acceleration Manager →
Big Ip Application Acceleration Manager by F5
View all CVEs affecting Big Ip Application Acceleration Manager →
Big Ip Application Acceleration Manager by F5
View all CVEs affecting Big Ip Application Acceleration Manager →
Big Ip Application Acceleration Manager by F5
View all CVEs affecting Big Ip Application Acceleration Manager →
Big Ip Application Acceleration Manager by F5
View all CVEs affecting Big Ip Application Acceleration Manager →
Big Ip Application Acceleration Manager by F5
View all CVEs affecting Big Ip Application Acceleration Manager →
Imagemagick by Imagemagick
Imagemagick by Imagemagick
Ubuntu Linux by Canonical
Ubuntu Linux by Canonical
Ubuntu Linux by Canonical
Ubuntu Linux by Canonical
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution with the privileges of the ImageMagick process, potentially leading to complete system compromise.
Likely Case
Denial of service through application crashes or memory corruption leading to unstable behavior.
If Mitigated
Limited impact if proper input validation and sandboxing are implemented, with crashes contained to the ImageMagick process.
🎯 Exploit Status
Exploitation requires crafting a malicious CUT image file. The vulnerability is in the decoder, so any processing of CUT files triggers the issue. Proof-of-concept code exists in the GitHub issue tracker.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: ImageMagick 7.0.8-50 or later, ImageMagick 6.9.10-50 or later
Vendor Advisory: https://github.com/ImageMagick/ImageMagick/issues/1599
Restart Required: No
Instructions:
1. Update ImageMagick to version 7.0.8-50 or later (or 6.9.10-50 for ImageMagick 6). 2. For Linux distributions, use your package manager: 'sudo apt update && sudo apt upgrade imagemagick' (Debian/Ubuntu) or 'sudo yum update imagemagick' (RHEL/CentOS). 3. For source installations, download and compile the patched version from the official repository.
🔧 Temporary Workarounds
Disable CUT format support
linuxRemove CUT format from ImageMagick's policy.xml to prevent processing of CUT images
Edit /etc/ImageMagick-6/policy.xml or /etc/ImageMagick-7/policy.xml
Add or modify: <policy domain="coder" rights="none" pattern="CUT" />
Input validation and sanitization
allImplement strict file type validation before passing images to ImageMagick
Implement server-side file type checking using magic bytes or other validation methods
🧯 If You Can't Patch
- Implement strict input validation to reject CUT format images at the application level
- Run ImageMagick in a sandboxed environment with minimal privileges to limit potential damage
🔍 How to Verify
Check if Vulnerable:
Check ImageMagick version with 'convert --version' or 'magick --version'. If version is below 7.0.8-50 (for ImageMagick 7) or below 6.9.10-50 (for ImageMagick 6), the system is vulnerable.
Check Version:
convert --version | head -1 || magick --version | head -1
Verify Fix Applied:
After updating, verify the version is 7.0.8-50 or higher (or 6.9.10-50 for ImageMagick 6) using 'convert --version' or 'magick --version'.
📡 Detection & Monitoring
Log Indicators:
- ImageMagick process crashes or segmentation faults
- Error messages related to CUT image processing
- Unusual memory usage patterns in ImageMagick processes
Network Indicators:
- Uploads of CUT format images to web applications
- Unusual spikes in image processing requests
SIEM Query:
process_name:"convert" OR process_name:"magick" AND (event_type:"crash" OR error_message:"CUT" OR error_message:"segmentation fault")
🔗 References
- http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00069.html
- https://github.com/ImageMagick/ImageMagick/commit/cdb383749ef7b68a38891440af8cc23e0115306d
- https://github.com/ImageMagick/ImageMagick/issues/1599
- https://github.com/ImageMagick/ImageMagick6/commit/1e59b29e520d2beab73e8c78aacd5f1c0d76196d
- https://lists.debian.org/debian-lts-announce/2019/08/msg00021.html
- https://lists.debian.org/debian-lts-announce/2020/09/msg00007.html
- https://support.f5.com/csp/article/K20336394
- https://support.f5.com/csp/article/K20336394?utm_source=f5support&%3Butm_medium=RSS
- https://usn.ubuntu.com/4192-1/
- https://www.debian.org/security/2020/dsa-4712
- http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00069.html
- https://github.com/ImageMagick/ImageMagick/commit/cdb383749ef7b68a38891440af8cc23e0115306d
- https://github.com/ImageMagick/ImageMagick/issues/1599
- https://github.com/ImageMagick/ImageMagick6/commit/1e59b29e520d2beab73e8c78aacd5f1c0d76196d
- https://lists.debian.org/debian-lts-announce/2019/08/msg00021.html
- https://lists.debian.org/debian-lts-announce/2020/09/msg00007.html
- https://support.f5.com/csp/article/K20336394
- https://support.f5.com/csp/article/K20336394?utm_source=f5support&%3Butm_medium=RSS
- https://usn.ubuntu.com/4192-1/
- https://www.debian.org/security/2020/dsa-4712