Skip to content
Memory corruption Advisory Advanced CVE-2019-5084

LEADTOOLS TIF ImageWidth code execution vulnerability

A heap out-of-bounds write exists in LEADTOOLS' TIF image parsing when a crafted TIF causes an offset beyond the allocated buffer to be written, potentially leading to code execution.

Marcin Towalski Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An exploitable heap out-of-bounds write vulnerability exists in the TIF-parsing functionality of LEADTOOLS 20. A specially crafted TIF image can cause an offset beyond the bounds of a heap allocation to be written, potentially resulting in code execution.

Marcin Towalski 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 allocation size calculation and the write offset calculation use inconsistent values (such as ImageWidth and SamplesPerPixel), so the offset can exceed the allocated buffer.

What the attacker needed

Victim opens a crafted TIF file

The fix

The vendor patched the vulnerability.

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 an image file, it sets aside a block of memory (a buffer) to hold the image data. If the file is crafted so that the program writes past the end of that block, it can corrupt other memory and sometimes let an attacker run their own code. This report describes such a flaw in a library that parses TIF images.

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

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.