Accusoft ImageGear TIF IP_planar_raster_unpack improper array index validation vulnerability
A malformed TIF file causes an out-of-bounds write in the IP_planar_raster_unpack function of Accusoft ImageGear 19.9 because the destination buffer size is computed from file-controlled tags and the write loop does not check the buffer bounds. An attacker could supply a crafted file to corrupt memory, potentially leading to code execution.
Originally disclosed on Cisco Talos
An improper array index validation vulnerability exists in the TIF IPplanarrasterunpack functionality of Accusoft ImageGear 19.9. A specially crafted malformed file can lead to an out-of-bounds write.
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 destination buffer size is derived from file-controlled tags without validating that the unpack loop's write index stays within that allocation.
Impact
An attacker could cause an out-of-bounds write that may lead to code execution.
What the attacker needed
Victim opens a crafted TIF file
How it was found
- Craft a TIF file with a planar configuration value of 2 and specific photometric tag values.
- Load the malformed TIF file with the ImageGear library.
- The library allocates a small destination buffer based on the file's tags.
- The unpack loop writes past the end of 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.
When the library opens a TIF image, it copies pixel data into a buffer sized from values in the file. A malformed file can make the copy write past the end of that buffer, corrupting nearby 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.