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

ImageMagick Convert Tiff Adobe Deflate Code Execution Vulnerability

ImageMagick's convert utility miscalculates the buffer size needed for decompressed data in Adobe Deflate compressed TIFF images, so a crafted TIFF causes an out of bounds write. Under the right circumstances this controlled write could be turned into remote code execution.

Tyler Bohan Follow

Originally disclosed on Cisco Talos

High 7.5 View original

An exploitable out of bounds write exists in the handling of compressed TIFF images in ImageMagicks’s convert utility. A crafted TIFF document can lead to an out of bounds write which in particular circumstances could be leveraged into remote code execution..

Tyler Bohan, 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 size calculated to hold the decompressed TIFF data is too small for the actual decompressed stream, and that undersized buffer is handed to the decompression routine.

Impact

A crafted TIFF processed by the convert utility causes an out of bounds write that, under proper circumstances, could be exploited into full remote code execution.

What the attacker needed

Victim processes a crafted TIFF; ImageMagick convert with TIFF support

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.

ImageMagick is a widely used tool that opens and converts images, and many websites use it to process pictures people upload. When it opens a compressed TIFF image, it reserves a memory area for the unpacked picture but makes that area too small, so unpacking spills past the end and overwrites neighbouring memory. An attacker who can get such an image processed may be able to take control of the program.

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

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