CVE-2023-34152
📋 TL;DR
CVE-2023-34152 is a critical remote code execution vulnerability in ImageMagick's OpenBlob function when compiled with --enable-pipes configuration. Attackers can exploit this by processing malicious images, potentially gaining full system control. This affects any system using vulnerable ImageMagick versions with pipes enabled.
💻 Affected Systems
- ImageMagick
📦 What is this software?
Extra Packages For Enterprise Linux by Fedoraproject
View all CVEs affecting Extra Packages For Enterprise Linux →
Fedora by Fedoraproject
Fedora by Fedoraproject
Imagemagick by Imagemagick
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise with root/admin privileges, data exfiltration, ransomware deployment, and persistent backdoor installation.
Likely Case
Remote code execution with the privileges of the ImageMagick process, leading to data theft, lateral movement, or cryptomining.
If Mitigated
Limited impact due to sandboxing, minimal privileges, or network segmentation preventing full system compromise.
🎯 Exploit Status
Exploitation requires processing a malicious image file. Public PoC exists in GitHub issues.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: ImageMagick 7.1.1-15 and 6.9.12-90
Vendor Advisory: https://access.redhat.com/security/cve/CVE-2023-34152
Restart Required: Yes
Instructions:
1. Update ImageMagick using your package manager: 'sudo apt update && sudo apt upgrade imagemagick' (Debian/Ubuntu) or 'sudo yum update imagemagick' (RHEL/CentOS). 2. Restart any services using ImageMagick. 3. Verify the update with 'convert --version'.
🔧 Temporary Workarounds
Disable pipe support
linuxRecompile ImageMagick without --enable-pipes configuration
./configure --disable-pipes
make
sudo make install
Use policy.xml restrictions
allLimit ImageMagick's capabilities via policy configuration
Edit /etc/ImageMagick-7/policy.xml or /etc/ImageMagick-6/policy.xml to restrict delegate execution
🧯 If You Can't Patch
- Isolate ImageMagick processing to dedicated, sandboxed containers with minimal privileges
- Implement strict input validation and file type checking before passing images to ImageMagick
🔍 How to Verify
Check if Vulnerable:
Check ImageMagick version with 'convert --version' or 'magick --version'. If version is below 7.1.1-15 (for ImageMagick 7) or 6.9.12-90 (for ImageMagick 6), and compiled with pipes enabled, it's vulnerable.
Check Version:
convert --version | head -1
Verify Fix Applied:
Confirm version is 7.1.1-15 or higher (ImageMagick 7) or 6.9.12-90 or higher (ImageMagick 6) using 'convert --version'.
📡 Detection & Monitoring
Log Indicators:
- Unusual process execution from ImageMagick
- Suspicious command execution in system logs following image processing
- Failed image processing attempts with malformed files
Network Indicators:
- Outbound connections from ImageMagick processes to unexpected destinations
- Unusual data exfiltration following image uploads
SIEM Query:
process.name:"convert" OR process.name:"magick" AND (process.args:"pipe" OR process.args:"|" OR process.args:"sh" OR process.args:"bash")
🔗 References
- https://access.redhat.com/security/cve/CVE-2023-34152
- https://bugzilla.redhat.com/show_bug.cgi?id=2210659
- https://github.com/ImageMagick/ImageMagick/issues/6339
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/4UFQJCYJ23HWHNDOVKBHZQ7HCXXL6MM3/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/V2ZUHZXQ2C3JZYKPW4XHCMVVL467MA2V/
- https://access.redhat.com/security/cve/CVE-2023-34152
- https://bugzilla.redhat.com/show_bug.cgi?id=2210659
- https://github.com/ImageMagick/ImageMagick/issues/6339
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/4UFQJCYJ23HWHNDOVKBHZQ7HCXXL6MM3/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/V2ZUHZXQ2C3JZYKPW4XHCMVVL467MA2V/