Skip to content
Memory corruption Advisory Advanced CVE-2021-21773

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.

Emmanuel Tacheau Follow

Originally disclosed on Cisco Talos

High 8.1 View original

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.

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 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

  1. Craft a malformed TIFF file with a zero count value for ImageWidth or ImageLength.
  2. Load the file using the ImageGear library.
  3. 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.

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.