Accusoft ImageGear BMP bmp_parsing buffer size computation code execution vulnerability
An integer overflow in the bmp_parsing function of Accusoft ImageGear 19.5.0 can cause an out-of-bounds write when processing a specially crafted BMP file, potentially leading to remote code execution. An attacker must provide a malformed file to the victim to trigger the vulnerability.
Originally disclosed on Cisco Talos
An exploitable out-of-bounds write vulnerability exists in the bmpparsing function of the igcore19d.dll library of Accusoft ImageGear, version 19.5.0. A specially crafted BMP file can cause an out-of-bounds write, resulting in a remote code execution.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely an integer overflow when multiplying the image width by 4 to compute the buffer size, without checking for overflow, leading to an undersized allocation and subsequent out-of-bounds write.
What the attacker needed
Victim opens a malformed BMP file
How it was found
- Craft a malformed BMP file with a width value that causes an integer overflow when multiplied by 4.
- Load the malformed BMP file using the IG_load_file function.
- The bmp_parsing function calculates total_width as 4 * width, which overflows and wraps around.
- The buffer is allocated with the wrapped-around size, which is too small.
- The loop writes pixel data into the buffer, causing an out-of-bounds write.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This report describes a bug in a library that reads image files. When the library processes a malicious BMP image, it miscalculates how much memory to reserve, then writes data past the end of that memory. This can crash the program or, in the worst case, let an attacker run their own code.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.