Skip to content
OpenAdvisories
High · 7.5 CVE-2025-57803 EUVD-2025-25837GHSA-mxvv-97wh-cfmm

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

Published Aug 26, 2025 · Updated Feb 26, 2026 · Assigned by GitHub_M

Description

ImageMagick is free and open-source software used for editing and manipulating digital images. Prior to versions 6.9.13-28 and 7.1.2-2 for ImageMagick's 32-bit build, a 32-bit integer overflow in the BMP encoder’s scanline-stride computation collapses bytes_per_line (stride) to a tiny value while the per-row writer still emits 3 × width bytes for 24-bpp images. The row base pointer advances using the (overflowed) stride, so the first row immediately writes past its slot and into adjacent heap memory with attacker-controlled bytes. This is a classic, powerful primitive for heap corruption in common auto-convert pipelines. This issue has been patched in versions 6.9.13-28 and 7.1.2-2.

Affected products

VendorProductAffectedFixed
ImageMagick ImageMagick < 7.1.2-2, < 6.9.13-28 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 imagemagick 8:7.1.2.3+dfsg1-1 —
Debian 13 imagemagick 8:7.1.1.43+dfsg1-1+deb13u2 DSA-5997-1
Debian 12 imagemagick 8:6.9.11.60+dfsg-1.6+deb12u4 DSA-5997-1
Debian 11 imagemagick 8:6.9.11.60+dfsg-1.3+deb11u6 DLA-4297-1
ReleasePackageFixed inAdvisory
Ubuntu Pro 24.04 LTS imagemagick 8:6.9.12.98+dfsg1-5.2ubuntu0.1~esm3 USN-7812-1
Ubuntu Pro 22.04 LTS imagemagick 8:6.9.11.60+dfsg-1.3ubuntu0.22.04.5+esm4 USN-7812-1
Ubuntu Pro 20.04 LTS imagemagick 8:6.9.10.23+dfsg-2.1ubuntu11.11+esm4 USN-7812-1
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 18.04 LTS imagemagick 8:6.9.7.4+dfsg-16ubuntu6.15+esm6 USN-7812-1
Ubuntu Pro 16.04 LTS imagemagick 8:6.8.9.9-7ubuntu5.16+esm14 USN-7812-1
Ubuntu Pro 14.04 LTS imagemagick 8:6.7.7.10-6ubuntu3.13+esm15 USN-7812-1
ReleasePackageFixed inAdvisory
RHEL 7 ELS ImageMagick +5 6.9.10.68-9.el7_9 RHSA-2025:16313
ReleasePackageFixed inAdvisory
SLES 15 SP7 ImageMagick 7.1.0.9-150400.6.40.1 SUSE-SU-2025:03152-1, SUSE-SU-2025:03113-1
SLES 15 SP6 ImageMagick 7.1.0.9-150400.6.40.1 SUSE-SU-2025:03164-1, SUSE-SU-2025:03152-1
SLES 15 SP5 ImageMagick 7.1.0.9-150400.6.40.1 SUSE-SU-2025:03152-1
SLES 15 SP4 ImageMagick 7.1.0.9-150400.6.40.1 SUSE-SU-2025:03152-1
SLES 15 SP3 ImageMagick 7.0.7.34-150200.10.62.1 SUSE-SU-2025:03151-1
Show 10 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES 12 SP5 ImageMagick 6.8.8.1-71.212.1 SUSE-SU-2025:03150-1
SLES for SAP 16.0 ImageMagick 7.1.2.0-160000.4.1 SUSE-SU-2025:21211-1
SLES for SAP 15 SP5 ImageMagick 7.1.0.9-150400.6.40.1 SUSE-SU-2025:03152-1
SLES for SAP 15 SP4 ImageMagick 7.1.0.9-150400.6.40.1 SUSE-SU-2025:03152-1
SLES for SAP 15 SP3 ImageMagick 7.0.7.34-150200.10.62.1 SUSE-SU-2025:03151-1
SLES 16.0 ImageMagick 7.1.2.0-160000.4.1 SUSE-SU-2025:21211-1
SLE HPC 15 SP5 ImageMagick 7.1.0.9-150400.6.40.1 SUSE-SU-2025:03152-1
SLE HPC 15 SP4 ImageMagick 7.1.0.9-150400.6.40.1 SUSE-SU-2025:03152-1
SLE HPC 15 SP3 ImageMagick 7.0.7.34-150200.10.62.1 SUSE-SU-2025:03151-1
SUSE Enterprise Storage 7.1 ImageMagick 7.0.7.34-150200.10.62.1 SUSE-SU-2025:03151-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed ImageMagick 7.1.2.2-2.1 openSUSE-SU-2025:15498-1
openSUSE Leap 16.0 ImageMagick 7.1.2.0-160000.4.1 openSUSE-SU-2025:20162-1
openSUSE Leap 15.6 ImageMagick 7.1.1.21-150600.3.20.1 SUSE-SU-2025:03164-1
ReleasePackageFixed inAdvisory
Alpine v3.24 imagemagick 7.1.2.8-r0 —
Alpine v3.23 imagemagick 7.1.2.8-r0 —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 7 ImageMagick +5 6.9.10.68-7.0.3.el7_9 ELSA-2025-16313

Affected packages

EcosystemPackageAffectedFixedRecord
NuGet Magick.NET-Q16-AnyCPU < 14.8.1 14.8.1 GHSA-mxvv-97wh-cfmm
NuGet Magick.NET-Q16-HDRI-AnyCPU < 14.8.1 14.8.1 GHSA-mxvv-97wh-cfmm
NuGet Magick.NET-Q16-HDRI-x86 < 14.8.1 14.8.1 GHSA-mxvv-97wh-cfmm
NuGet Magick.NET-Q16-x86 < 14.8.1 14.8.1 GHSA-mxvv-97wh-cfmm
NuGet Magick.NET-Q8-AnyCPU < 14.8.1 14.8.1 GHSA-mxvv-97wh-cfmm
NuGet Magick.NET-Q8-x86 < 14.8.1 14.8.1 GHSA-mxvv-97wh-cfmm

Advisories 16

References