CVE-2019-19948

9.8 CRITICAL

📋 TL;DR

This vulnerability allows remote attackers to execute arbitrary code via a specially crafted SGI image file. It affects ImageMagick installations that process untrusted image files, particularly web applications that use ImageMagick for image conversion or processing.

💻 Affected Systems

Products:
  • ImageMagick
Versions: 7.0.8-43 Q16 and earlier versions
Operating Systems: Linux, Windows, macOS, BSD
Default Config Vulnerable: ⚠️ Yes
Notes: Any system using ImageMagick to process SGI image files is vulnerable. Web applications using ImageMagick libraries are particularly at risk.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data theft, or ransomware deployment.

🟠

Likely Case

Denial of service through application crashes, or limited code execution in sandboxed environments.

🟢

If Mitigated

No impact if ImageMagick doesn't process untrusted SGI files or is properly sandboxed.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires only a malicious SGI image file. Public proof-of-concept code exists in the GitHub issue tracker.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 7.0.8-44 and later

Vendor Advisory: https://github.com/ImageMagick/ImageMagick/issues/1562

Restart Required: No

Instructions:

1. Update ImageMagick to version 7.0.8-44 or later. 2. For Linux: Use package manager (apt-get upgrade imagemagick, yum update imagemagick). 3. For Windows: Download updated binaries from ImageMagick website. 4. For source installations: Recompile from patched source.

🔧 Temporary Workarounds

Disable SGI coder

linux

Remove or disable the SGI image format support in ImageMagick policy.xml

Edit /etc/ImageMagick-7/policy.xml and add: <policy domain="coder" rights="none" pattern="SGI" />

Sandbox ImageMagick

linux

Run ImageMagick in a container or with reduced privileges

docker run --security-opt no-new-privileges -v /tmp:/tmp imagemagick

🧯 If You Can't Patch

  • Implement strict input validation to reject SGI files at the application level
  • Deploy network segmentation and restrict ImageMagick to isolated processing servers

🔍 How to Verify

Check if Vulnerable:

Run: convert -version | grep 'Version: ImageMagick' and check if version is 7.0.8-43 or earlier

Check Version:

convert -version | grep 'Version: ImageMagick'

Verify Fix Applied:

After update, verify version is 7.0.8-44 or later with same command

📡 Detection & Monitoring

Log Indicators:

  • ImageMagick segmentation faults
  • Process crashes when handling image files
  • Unusual memory allocation patterns

Network Indicators:

  • Unexpected outbound connections from ImageMagick processes
  • Large SGI file uploads to web applications

SIEM Query:

process_name:"convert" AND (event_type:"crash" OR memory_usage:"spike")

🔗 References

📤 Share & Export