ADVISORIES

Red Hat VEX

RHVEX-CVE-2025-57803

imagemagick: ImageMagick (WriteBMPImage): 32-bit integer overflow when writing BMP scanline stride → heap buffer overflow

Important No fix available CVE-2025-57803

Details

A flaw was found in ImageMagick. In 32-bit builds, the Bitmap encoder miscalculates the stride value when processing images with very large with. Mathematically, the stride value is calculated as width multiplied by 3 but the theoretical limit of such value is 2^32 for 32-bit integers. So, if this value is exceeded, the encoder uses modulo to convert it down and then takes the smaller value as the actual stride length. This is problematic because the pixel data starts to overlap when being added to the buffer due to the small stride value messing up the rows. This heap buffer overflow allows an attacker to cause a denial of service or, with crafted input, potentially execute arbitrary code.

Affected packages

EcosystemPackageAffected versions
Red Hat:enterprise_linux:6ImageMagick
All versions, will not be fixed
Red Hat:enterprise_linux:6ImageMagick-c++
All versions, will not be fixed
Red Hat:enterprise_linux:6ImageMagick-c++-devel
All versions, will not be fixed
Red Hat:enterprise_linux:6ImageMagick-devel
All versions, will not be fixed
Red Hat:enterprise_linux:6ImageMagick-doc
All versions, will not be fixed
Red Hat:enterprise_linux:6ImageMagick-perl
All versions, will not be fixed

References