Skip to content
Memory corruption Advisory Advanced CVE-2016-8331

LibTIFF Tag Extension Remote Code Execution Vulnerability

A type confusion in LibTIFF's handling of the BadFaxLines tag (326) causes an out-of-bounds write when a crafted TIFF file is processed, potentially leading to remote code execution.

Tyler Bohan Follow

Originally disclosed on Cisco Talos

High 8.1 View original

An exploitable remote code execution vulnerability exists in the handling of TIFF images in LibTIFF. A crafted TIFF document can lead to a type confusion vulnerability resulting in remote code execution.

Tyler Bohan and Cory Duplantis, 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

Likely, the field type for tag 326 is set to double, but the variable argument list passed to the function is empty, so va_arg reads an invalid pointer and writes to it.

What the attacker needed

Victim opens a crafted TIFF file

How it was found

  1. Create a TIFF file containing tag 326 (BadFaxLines) with a double field type.
  2. Run the LibTIFF thumbnail utility on the crafted TIFF file.
  3. The utility calls TIFFGetField for tag 326, which leads to a crash due to 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.

LibTIFF is a library for reading and writing TIFF image files. A type confusion happens when the program expects one kind of data but gets another, causing it to write to the wrong place in memory. This can crash the program or let an attacker 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 Tyler Bohan

View all

1 more disclosed report, 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.