Accusoft ImageGear TIFF Header count processing out-of-bounds write vulnerability
A malformed TIFF file can cause an out-of-bounds write in Accusoft ImageGear 19.8 because the library allocates a buffer based on a count value from the file without checking it. An attacker could exploit this to corrupt memory and potentially execute code.
Originally disclosed on Cisco Talos
An out-of-bounds write vulnerability exists in the TIFF header count-processing functionality of Accusoft ImageGear 19.8. A specially crafted malformed file can lead to memory corruption.
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
The function tiff_read_sub_1 allocates a buffer based on a count value from the TIFF file without validating it, and when the count is zero, malloc returns a 1-byte buffer that is then written to as if it were a full structure.
Impact
An attacker could cause memory corruption and potentially execute arbitrary code.
What the attacker needed
Victim opens a malicious TIFF file
The fix
The vulnerability was fixed by the vendor.
How it was found
- Craft a malformed TIFF file with a zero count value for ImageWidth or ImageLength.
- Load the file using the ImageGear library.
- The library allocates a 1-byte buffer and then writes to it, 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 a program reads a file, it often uses numbers from the file to decide how much memory to set aside. Here, the program used a number from the TIFF file to allocate memory, but if that number is zero, it still tries to write data into the tiny buffer, causing memory corruption. This could let an attacker run their own code on the victim's computer.
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.