{"id":"CVE-2025-57803","published":"2025-08-26T17:25:59Z","modified":"2026-02-26T17:48:11Z","title":"ImageMagick (WriteBMPImage): 32-bit integer overflow when writing BMP scanline stride → heap buffer overflow","vendor":"ImageMagick","product":"ImageMagick","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00928,"percentile":0.588,"provenance":"source"},"cwes":[{"id":"CWE-122","name":"Heap-based Buffer Overflow"},{"id":"CWE-190","name":"Integer Overflow or Wraparound"}],"references":[{"url":"https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-mxvv-97wh-cfmm","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/ImageMagick/ImageMagick/commit/2c55221f4d38193adcb51056c14cf238fbcc35d7","tags":["x_refsource_MISC"]},{"url":"https://github.com/dlemstra/Magick.NET/releases/tag/14.8.1","tags":["x_refsource_MISC"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/09/msg00012.html","tags":[]}],"priority":{"score":17.0,"factors":[{"name":"EPSS percentile","points":11.76},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"imagemagick","affectedVersions":[{"vendor":"ImageMagick","product":"ImageMagick","versions":["< 7.1.2-2","< 6.9.13-28"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2025-10-24T03:55:19.284114Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"NuGet","package":"Magick.NET-Q16-AnyCPU","vulnerableRanges":["<14.8.1"],"patched":["14.8.1"],"from":["GHSA-mxvv-97wh-cfmm"],"provenance":"source"},{"ecosystem":"NuGet","package":"Magick.NET-Q16-HDRI-AnyCPU","vulnerableRanges":["<14.8.1"],"patched":["14.8.1"],"from":["GHSA-mxvv-97wh-cfmm"],"provenance":"source"},{"ecosystem":"NuGet","package":"Magick.NET-Q16-HDRI-x86","vulnerableRanges":["<14.8.1"],"patched":["14.8.1"],"from":["GHSA-mxvv-97wh-cfmm"],"provenance":"source"},{"ecosystem":"NuGet","package":"Magick.NET-Q16-x86","vulnerableRanges":["<14.8.1"],"patched":["14.8.1"],"from":["GHSA-mxvv-97wh-cfmm"],"provenance":"source"},{"ecosystem":"NuGet","package":"Magick.NET-Q8-AnyCPU","vulnerableRanges":["<14.8.1"],"patched":["14.8.1"],"from":["GHSA-mxvv-97wh-cfmm"],"provenance":"source"},{"ecosystem":"NuGet","package":"Magick.NET-Q8-x86","vulnerableRanges":["<14.8.1"],"patched":["14.8.1"],"from":["GHSA-mxvv-97wh-cfmm"],"provenance":"source"}],"summary":{"text":"A flaw in ImageMagick's BMP encoder (WriteBMPImage) means that, in the 32-bit build, a 32-bit integer overflow in the scanline-stride computation for 24-bpp images causes the stride to collapse to a tiny value while rows are still written at 3 × width bytes. An attacker who can get ImageMagick to write a BMP image in an affected 32-bit build could corrupt adjacent heap memory with attacker-controlled bytes.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:50:09Z"},"euvd":{"id":"EUVD-2025-25837","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-imagemagick-cve-2025-57803","children":[{"from":"CVE-2025-57803","to":"CVE-2025-62171","relation":"incomplete-fix","confidence":"high","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"incomplete-fix","quote":"The overflow check added to address CVE-2025-57803 is placed after the overflow occurs, making it ineffective.","from":"CVE.org","in":"CVE-2025-62171"},{"kind":"version-step","provenance":"source","package":"NuGet:Magick.NET-Q16-AnyCPU","fromFixed":"14.8.1","toFixed":"14.9.0","daysApart":52},{"kind":"version-step","provenance":"source","package":"NuGet:Magick.NET-Q16-HDRI-AnyCPU","fromFixed":"14.8.1","toFixed":"14.9.0","daysApart":52},{"kind":"same-code","provenance":"machine","files":["coders/bmp.c"],"commits":["https://github.com/ImageMagick/ImageMagick/commit/2c55221f4d38193adcb51056c14cf238fbcc35d7","https://github.com/ImageMagick/ImageMagick/commit/cea1693e2ded51b4cc91c70c54096cbed1691c00"],"basis":"shared file"}]}],"packageHistory":[{"cve":"CVE-2025-55154","published":"2025-08-13","fixed":"14.8.0","kev":false,"link":{"from":"CVE-2025-55154","to":"CVE-2025-57803","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"NuGet:Magick.NET-Q16-x86","fromFixed":"14.8.0","toFixed":"14.8.1","daysApart":13},{"kind":"version-step","provenance":"source","package":"NuGet:Magick.NET-Q8-x86","fromFixed":"14.8.0","toFixed":"14.8.1","daysApart":13}]}},{"cve":"CVE-2025-57803","published":"2025-08-26","fixed":"14.8.1","kev":false},{"cve":"CVE-2025-62171","published":"2025-10-17","fixed":"14.9.0","kev":false},{"cve":"CVE-2025-66628","published":"2025-12-10","fixed":"14.10.0","kev":false},{"cve":"CVE-2025-68618","published":"2025-12-30","fixed":"14.10.1","kev":false}],"package":"NuGet:Magick.NET-Q16-x86"}}