Accusoft ImageGear parse_raster_data out-of-bounds write vulnerability
A malformed PICT image file causes the ImageGear library to write past the end of a heap buffer while decoding raster data, because the size used for the write does not match the size of the allocation. An attacker could supply such a file to corrupt memory, which may lead to code execution.
Originally disclosed on Cisco Talos
An out-of-bounds write vulnerability exists in the parserasterdata functionality of Accusoft ImageGear 19.10. 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
Likely the destination buffer is allocated using one size value while the copy routine is given a different, attacker-influenced size, so the bounds check inside the copy routine does not match the real allocation.
Impact
A crafted file could cause memory corruption, which may lead to code execution, though the report only demonstrates a crash under a debugger.
What the attacker needed
Victim opens a crafted PICT file; ImageGear 19.10 used to parse it
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 an image file, it reserves a block of memory (a buffer) to hold the decoded picture. Here the program reserved a very small block but then copied more bytes into it than it had room for, so the extra bytes spill into neighbouring memory. A crafted image file can trigger this, and spilling over memory like that can crash the program or let an attacker take control of it.
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.