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.
Originally disclosed on Cisco Talos
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.
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
- Create a TIFF file containing tag 326 (BadFaxLines) with a double field type.
- Run the LibTIFF thumbnail utility on the crafted TIFF file.
- 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.