CVE-2026-25985
📋 TL;DR
ImageMagick versions prior to 7.1.2-15 and 6.9.13-40 contain a memory allocation vulnerability in SVG processing. A malicious SVG file with a crafted element can trigger an attempt to allocate approximately 674 GB of memory, causing an out-of-memory abort and denial of service. This affects any system using vulnerable ImageMagick versions to process SVG files.
💻 Affected Systems
- ImageMagick
📦 What is this software?
Imagemagick by Imagemagick
Imagemagick by Imagemagick
⚠️ Risk & Real-World Impact
Worst Case
Complete denial of service causing application crashes, service unavailability, and potential system instability when processing malicious SVG files.
Likely Case
Application crashes or aborts when processing malicious SVG files, leading to service disruption for image processing functionality.
If Mitigated
Minimal impact with proper input validation and memory limits in place, though processing may still fail gracefully.
🎯 Exploit Status
Exploitation requires only a crafted SVG file to be processed by vulnerable ImageMagick. No authentication or special privileges needed.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 7.1.2-15 and 6.9.13-40
Vendor Advisory: https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-v7g2-m8c5-mf84
Restart Required: No
Instructions:
1. Update ImageMagick to version 7.1.2-15 or 6.9.13-40 using your package manager. 2. For Linux: 'sudo apt update && sudo apt upgrade imagemagick' (Debian/Ubuntu) or 'sudo yum update imagemagick' (RHEL/CentOS). 3. Verify installation with 'convert --version'.
🔧 Temporary Workarounds
Disable SVG processing
linuxRemove or disable SVG support in ImageMagick policy.xml to prevent processing of SVG files.
sudo sed -i '/<policy domain="delegate" rights="none" pattern="SVG" \/>/d' /etc/ImageMagick-6/policy.xml
echo '<policy domain="delegate" rights="none" pattern="SVG" />' | sudo tee -a /etc/ImageMagick-6/policy.xml
Set memory limits
linuxConfigure ImageMagick memory limits to prevent excessive allocation attempts.
echo '<policy domain="resource" name="memory" value="256MiB"/>' | sudo tee -a /etc/ImageMagick-6/policy.xml
echo '<policy domain="resource" name="map" value="512MiB"/>' | sudo tee -a /etc/ImageMagick-6/policy.xml
🧯 If You Can't Patch
- Implement strict input validation to reject or sanitize SVG files before processing.
- Deploy ImageMagick in containerized environments with memory limits enforced at the container level.
🔍 How to Verify
Check if Vulnerable:
Check ImageMagick version with 'convert --version' or 'magick --version'. If version is below 7.1.2-15 (for ImageMagick 7) or 6.9.13-40 (for ImageMagick 6), system is vulnerable.
Check Version:
convert --version
Verify Fix Applied:
After patching, verify version is 7.1.2-15 or higher (for ImageMagick 7) or 6.9.13-40 or higher (for ImageMagick 6) using 'convert --version'.
📡 Detection & Monitoring
Log Indicators:
- ImageMagick process crashes with out-of-memory errors
- Application logs showing failed image processing operations
- System logs indicating memory allocation failures
Network Indicators:
- Unusual spikes in SVG file uploads to image processing services
- Increased error rates in image processing APIs
SIEM Query:
source="*imagemagick*" AND ("out of memory" OR "abort" OR "allocation failed")