CVE-2022-32547

7.8 HIGH

📋 TL;DR

This CVE is an alignment vulnerability in ImageMagick's property.c file where misaligned memory access for double and float types can cause undefined behavior. It affects applications that process untrusted image files using vulnerable ImageMagick versions, potentially leading to crashes or availability issues. Any system using ImageMagick to handle user-uploaded or external images is at risk.

💻 Affected Systems

Products:
  • ImageMagick
  • ImageMagick6
Versions: ImageMagick versions before 7.1.0-39 and ImageMagick6 versions before 6.9.12-39
Operating Systems: All operating systems running vulnerable ImageMagick versions
Default Config Vulnerable: ⚠️ Yes
Notes: Any application or service that uses ImageMagick to process images (e.g., web applications, document converters, image processing pipelines) is vulnerable when handling untrusted input.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution or complete system compromise through memory corruption, though this is less likely given the alignment nature of the vulnerability.

🟠

Likely Case

Application crashes, denial of service, or unpredictable behavior when processing maliciously crafted image files.

🟢

If Mitigated

Minimal impact if proper input validation and sandboxing are implemented, with crashes contained to the ImageMagick process.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires crafting specific image files that trigger the alignment issue. While unauthenticated exploitation is possible via file upload, weaponization status is unclear from public sources.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: ImageMagick 7.1.0-39 and ImageMagick6 6.9.12-39

Vendor Advisory: https://github.com/ImageMagick/ImageMagick/commit/eac8ce4d873f28bb6a46aa3a662fb196b49b95d0

Restart Required: Yes

Instructions:

1. Identify ImageMagick version with 'convert --version' or 'magick --version'. 2. Update via package manager: 'apt update && apt upgrade imagemagick' (Debian/Ubuntu) or 'yum update imagemagick' (RHEL/CentOS). 3. Restart services using ImageMagick. 4. For source installations, download patched version from ImageMagick website and recompile.

🔧 Temporary Workarounds

Disable vulnerable image formats

linux

Remove or disable ImageMagick's ability to process potentially malicious image formats via policy.xml

Edit /etc/ImageMagick-6/policy.xml or /etc/ImageMagick-7/policy.xml
Add: <policy domain="coder" rights="none" pattern="*" />

Implement input validation

all

Validate and sanitize all image inputs before processing with ImageMagick

Use file type verification before passing to ImageMagick
Implement size limits and format restrictions

🧯 If You Can't Patch

  • Implement strict input validation and file type checking for all image uploads
  • Run ImageMagick in a sandboxed/containerized environment with limited privileges

🔍 How to Verify

Check if Vulnerable:

Check ImageMagick version: 'convert --version' or 'magick --version'. If version is below 7.1.0-39 (ImageMagick7) or 6.9.12-39 (ImageMagick6), system is vulnerable.

Check Version:

convert --version 2>/dev/null || magick --version 2>/dev/null || echo 'ImageMagick not found'

Verify Fix Applied:

After patching, verify version is at or above patched versions. Test with known safe image processing to ensure functionality.

📡 Detection & Monitoring

Log Indicators:

  • ImageMagick process crashes or segmentation faults in system logs
  • Unusual image processing errors in application logs
  • Failed image conversion attempts with malformed files

Network Indicators:

  • Unusual volume of image uploads to vulnerable endpoints
  • Requests with crafted image files to image processing services

SIEM Query:

source="*syslog*" AND ("segmentation fault" OR "SIGSEGV") AND process="convert" OR process="magick"

🔗 References

📤 Share & Export