CVE-2025-57803
7.5ImageMagick · ImageMagick
A heap-based buffer overflow in the ImageMagick BMP encoder allows for memory corruption via a 32-bit integer overflow in the scanline-stride computation.
Executive summary
ImageMagick is vulnerable to a heap-based buffer overflow that could allow a remote attacker to achieve memory corruption and potentially execute arbitrary code.
Vulnerability
This vulnerability is a heap-based buffer overflow caused by an integer overflow in the BMP encoder. An authenticated attacker can trigger this flaw during image processing to write attacker-controlled bytes into adjacent heap memory.
Business impact
The ability to corrupt heap memory in a core image processing library poses a significant risk to data integrity and system availability. Successful exploitation could lead to arbitrary code execution within the context of the application, potentially resulting in full system compromise or the unauthorized exfiltration of sensitive data. Given the CVSS score of 7.5, this vulnerability is classified as High severity and requires prompt attention, particularly in environments that automatically process untrusted image files.
Remediation
Immediate Action: Update ImageMagick to version 7.1.2-2 or 6.9.13-28. For users of the .NET ecosystem, update Magick.NET packages to version 14.8.1.
Proactive Monitoring: Monitor application logs for unexpected crashes or errors during image transcoding, which may indicate attempted exploitation of heap memory.
Compensating Controls: Ensure that image processing services are running with the least privilege necessary, ideally within a sandboxed or containerized environment to limit the impact of potential code execution.
Exploitation status
Public Exploit Available: Unknown
Analyst recommendation
The severity of this integer overflow vulnerability is elevated by its potential use in automated image processing pipelines, which are common attack surfaces. Administrators should prioritize updating ImageMagick instances to the patched versions immediately to eliminate the heap corruption vector. Failure to patch may expose systems to sophisticated memory corruption attacks that bypass traditional perimeter defenses.