Skip to content
Memory corruption Advisory Advanced CVE-2020-13571

Accusoft ImageGear SGI RLE decompression out-of-bounds write vulnerability

A missing size check in the SGI RLE decompression of Accusoft ImageGear 19.8 allows a crafted file to cause an out-of-bounds write via a memcpy, potentially leading to code execution.

Emmanuel Tacheau Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

An out-of-bounds write vulnerability exists in the SGI RLE decompression functionality of Accusoft ImageGear 19.8. A specially crafted malformed file can lead to code execution.

Emmanuel Tacheau, on Cisco Talos

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 program reads a length value from the file and uses it to copy data into a buffer without checking that the length does not exceed the buffer's size.

Impact

A specially crafted file can cause an out-of-bounds write, leading to memory corruption and possibly code execution.

What the attacker needed

RLE compression used; zsize >= 4; negative starttab entry; rlelength > scanline size

The fix

The vendor patched the vulnerability, likely by adding a check that the read length does not exceed the allocated buffer size.

How it was found

  1. Craft an SGI file with RLE compression enabled.
  2. Set the zsize (number of channels) to 4 or more.
  3. Place a negative value in the starttab table for the rleoffset.
  4. Set the rlelength to a value larger than the scanline size.
  5. Ensure the file size is larger than the scanline size.
  6. Open the file with the vulnerable library to trigger the 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 an image file is opened, the program reads compressed data into a fixed-size buffer. If the file claims the data is larger than the buffer, the program writes past the end of the buffer, corrupting memory. An attacker can craft such a file to crash the program or 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.

More by Emmanuel Tacheau

View all

58 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.