ImageMagick is an open source software suite for displaying, converting, and editing raster image files. In ImageMagick versions prior to 7.1.2-7 and 6.9.13-32, an integer overflow vulnerability exists in the BMP decoder on 32-bit systems. The vulnerability occurs in coders/bmp.c when calculating the extent value by multiplying image columns by bits per pixel. On 32-bit systems with sizet of 4 bytes, a malicious BMP file with specific dimensions can cause this multiplication to overflow and wrap to zero. The overflow check added to address CVE-2025-57803 is placed after the overflow occurs, making it ineffective. A specially crafted 58-byte BMP file with width set to 536,870,912 and 32 bits per pixel can trigger this overflow, causing the bytesperline calculation to become zero. This vulnerability only affects 32-bit builds of ImageMagick where default resource limits for width, height, and area have been manually increased beyond their defaults. 64-bit systems with sizet of 8 bytes are not vulnerable, and systems using default ImageMagick resource limits are not vulnerable. The vulnerability is fixed in versions 7.1.2-7 and 6.9.13-32.
{
"cwe_ids": [
"CWE-190"
]
}[
{
"source": "https://github.com/imagemagick/imagemagick/commit/cea1693e2ded51b4cc91c70c54096cbed1691c00",
"signature_version": "v1",
"digest": {
"function_hash": "17734602668377480444699567796676702492",
"length": 27844.0
},
"target": {
"function": "ReadBMPImage",
"file": "coders/bmp.c"
},
"id": "CVE-2025-62171-0eb22385",
"deprecated": false,
"signature_type": "Function"
},
{
"source": "https://github.com/imagemagick/imagemagick/commit/cea1693e2ded51b4cc91c70c54096cbed1691c00",
"signature_version": "v1",
"digest": {
"line_hashes": [
"119074875035416089284133514459964172964",
"24166337168158223140362467913609507320",
"4841360904932904501956919921859708375",
"162435976807236889147148370908587785070"
],
"threshold": 0.9
},
"target": {
"file": "coders/bmp.c"
},
"id": "CVE-2025-62171-7ed27306",
"deprecated": false,
"signature_type": "Line"
}
]