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

Kakadu Software SDK ATK marker code execution vulnerability

A malformed JP2 file with a crafted ATK marker segment causes an integer underflow in the derive_taps_and_gains function, so a heap buffer is allocated far too small and is then overflowed. An attacker could supply such a file to a victim to corrupt heap memory and potentially achieve remote code execution.

Aleksandar Nikolic Follow

Originally disclosed on Cisco Talos

High 8.1 View original

An exploitable heap underflow vulnerability exists in the derivetapsandgains function in kduv7ar.dll of Kakadu Software SDK 7.10.2. A specially crafted jp2 file can cause a heap overflow, which can result in remote code execution.

Aleksandar Nikolic and 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

Likely a signed integer underflow in the step support calculation makes the comparison that should grow the buffer size never succeed, so the buffer size stays at its initial value of one.

Impact

Heap metadata corruption could lead to remote code execution when a victim opens a crafted file, though the CVSS vector rates attack complexity as high.

What the attacker needed

Victim opens a crafted JP2 file; attacker can deliver a malformed file

How it was found

  1. Open a malformed JP2 file in a tool built on the SDK, such as the bundled renderer.
  2. The ATK marker segment supplies a large step support value that is read into step_info_n.
  3. The signed comparison underflows, so the buffer size variable is never increased.
  4. A 16-byte work buffer is allocated and then written past its end, corrupting heap metadata.

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.

Image files can carry extra metadata blocks, and this library trusts a number inside one of them when deciding how much memory to reserve. A signed arithmetic mistake makes the size check fail, so a tiny buffer is allocated and then written past its end, damaging nearby memory. If an attacker can get you to open such a file, they may be able to run their own code on your machine.

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