CVE-2026-140359: ImageMagick before 7.1.2-36 Heap Buffer Overflow via ShearRotateImage
ImageMagick before 6.9.13-61 and 7.x before 7.1.2-36 contains a heap buffer overflow in the ShearRotateImage method, where a specific argument causes a write beyond the bounds of a heap buffer. Attackers able to pass a crafted argument to ShearRotateImage, which is only reachable through the API, can corrupt heap memory and crash the application.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ImageMagickto a version that resolves this vulnerability.Fixed in 6.9.13-61 - Upgrade
Upgrade
ImageMagickto a version that resolves this vulnerability.Fixed in 7.1.2-36
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
The vulnerable code is reachable only through the ImageMagick API. Applications that call ShearRotateImage and allow an attacker to influence its argument are the relevant exposure; the provided information does not indicate that ordinary command-line use is affected.
What does an attacker need to exploit it?
An attacker must be able to pass a specifically crafted argument to ShearRotateImage through an application using the API. Exploitation can corrupt heap memory and crash the application.
Which versions need to be updated?
Update ImageMagick 6.x to 6.9.13-61 or later, or ImageMagick 7.x to 7.1.2-36 or later. Versions before those releases are affected.
How can I assess whether my application is affected?
Check both the installed ImageMagick version and whether the application invokes ShearRotateImage through the API. If the version is below the fixed release and untrusted input can reach that method's argument, the application is affected.