Accusoft ImageGear JPEG jpegread precision code execution vulnerability
A specially crafted JPEG file can cause an out-of-bounds write in the Accusoft ImageGear library's JPEG parser, leading to memory corruption and potentially 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 igcore19d.dll JPEG jpegread precision parser of the Accusoft ImageGear 19.5.0 library. A specially crafted JPEG 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 the buffer size calculation uses a precision value that is smaller than the actual loop count, so the loop writes more data than the allocated buffer can hold.
Impact
An attacker could cause memory corruption and potentially achieve remote code execution by providing a malformed JPEG file to the victim.
What the attacker needed
Victim opens a malformed JPEG file
How it was found
- Craft a JPEG file with a precision value of 7, x_image of 0xDE, and nr_comp of 3.
- Load the malformed JPEG file using the IG_load_file function.
- The library allocates a buffer of 0x2b4 bytes based on the precision value.
- The vulnerable function loops 0xDE times, writing 6 bytes per iteration, 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 is a memory corruption bug in a library that reads JPEG images. When the library processes a malicious image, it writes data past the end of a reserved memory area, which can crash the program or let an attacker run their own code. The attacker needs to trick someone into opening the bad image file.
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.