Accusoft ImageGear PSD Header processing memory allocation out-of-bounds write vulnerability
A missing bounds check in the PSD header processing of Accusoft ImageGear 20.0 allows a specially crafted PSD file to cause an out-of-bounds heap write. An attacker can provide a malicious file to trigger memory corruption, potentially leading to code execution.
Originally disclosed on Cisco Talos
An out-of-bounds write vulnerability exists in the PSD Header processing memory allocation functionality of Accusoft ImageGear 20.0. 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 buffer size calculation for the PSD header processing does not account for the number of channels, leading to a buffer that is too small and subsequent out-of-bounds writes.
Impact
The out-of-bounds write can lead to memory corruption and possibly code execution.
What the attacker needed
Victim opens a malicious PSD file
How it was found
- Craft a malformed PSD file with specific header values.
- Load the file using the ImageGear library.
- The library processes the PSD header and allocates a buffer based on the header values.
- Due to the missing bounds check, the buffer is too small.
- The library writes channel 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.
When a program reads a file, it often allocates a buffer in memory to hold data. If the program doesn't check that the data fits within the buffer, it can write past the end, corrupting other memory. Here, a malformed PSD image file causes the program to write beyond a small buffer, which can crash the program or allow an attacker to 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.