CVE-2021-3610

7.5 HIGH

📋 TL;DR

This heap-based buffer overflow vulnerability in ImageMagick's TIFF image processing allows attackers to crash applications or potentially execute arbitrary code by providing malicious TIFF files. It affects systems running vulnerable ImageMagick versions that process TIFF images. The vulnerability stems from incorrect pixel array size calculation in the ReadTIFFImage() function.

💻 Affected Systems

Products:
  • ImageMagick
Versions: Versions prior to 7.0.11-14
Operating Systems: Linux, Windows, macOS, BSD
Default Config Vulnerable: ⚠️ Yes
Notes: Any application or service using ImageMagick to process TIFF images is vulnerable. This includes web applications, document processing systems, and image conversion services.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise if exploited successfully, allowing attackers to gain control of the affected system.

🟠

Likely Case

Application crash and denial of service through segmentation faults when processing malicious TIFF files, potentially disrupting image processing services.

🟢

If Mitigated

Limited impact with proper input validation and sandboxing, potentially only causing application crashes without code execution.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: LOW

🎯 Exploit Status

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

Exploitation requires crafting a malicious TIFF file. The vulnerability is in image parsing code, making it accessible to unauthenticated users who can upload or provide TIFF files.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 7.0.11-14 and later

Vendor Advisory: https://github.com/ImageMagick/ImageMagick/commit/930ff0d1a9bc42925a7856e9ea53f5fc9f318bf3

Restart Required: Yes

Instructions:

1. Update ImageMagick to version 7.0.11-14 or later using your package manager. 2. For Linux: 'sudo apt update && sudo apt upgrade imagemagick' (Debian/Ubuntu) or 'sudo yum update imagemagick' (RHEL/CentOS). 3. Restart any services using ImageMagick.

🔧 Temporary Workarounds

Disable TIFF coder

linux

Remove or disable the TIFF image format support in ImageMagick configuration

sudo mv /etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml.backup
echo '<policymap><policy domain="coder" rights="none" pattern="TIFF" /></policymap>' | sudo tee /etc/ImageMagick-6/policy.xml

Input validation

all

Implement strict file type validation to reject TIFF files before processing

🧯 If You Can't Patch

  • Implement network segmentation to isolate ImageMagick services
  • Use application sandboxing or containerization to limit impact

🔍 How to Verify

Check if Vulnerable:

Check ImageMagick version with 'convert --version' or 'magick --version' and verify it's below 7.0.11-14

Check Version:

convert --version | head -1

Verify Fix Applied:

Confirm version is 7.0.11-14 or higher with 'convert --version' and test with known safe TIFF files

📡 Detection & Monitoring

Log Indicators:

  • Segmentation fault errors in application logs
  • ImageMagick process crashes
  • Failed TIFF image processing attempts

Network Indicators:

  • Unusual TIFF file uploads to web applications
  • TIFF files from unexpected sources

SIEM Query:

source="*app.log*" AND "segmentation fault" AND "ImageMagick"

🔗 References

📤 Share & Export