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

LEADTOOLS libltdic.so DICOM LDicomNet::SendData Code Execution Vulnerability

A specially crafted DICOM associate request can set the maximum length field to a very large value, which is then used to size a heap buffer. Adding six to that value overflows the integer, so a tiny buffer is allocated and then filled with file data, corrupting the heap and potentially allowing code execution.

Lilith >_> Follow

Originally disclosed on Cisco Talos

High 8.1 View original

An exploitable code execution vulnerability exists in the DICOM network response functionality of LEADTOOLS libltdic.so version 20.0.2019.3.15. A specially crafted packet can cause an integer overflow, resulting in heap corruption.

Lilith [;_;], 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 code adds six to an attacker-controlled 32-bit maximum length without checking for overflow, so the allocation size wraps to a very small value while the subsequent read still uses the large length.

Impact

An attacker could corrupt the heap and potentially execute code, though the CVSS score notes high attack complexity and the overflow only occurs when the server copies the client's maximum length into its response.

What the attacker needed

Network access to a DICOM listener; server copies client max length into response

The fix

The vendor patched the issue in December 2019.

How it was found

  1. Send an associate request whose user data maximum length field is set to a very large value.
  2. Have the server copy that maximum length into its own associate response.
  3. Send a C-FIND request so the server prepares a data response.
  4. The server allocates a buffer of the wrapped small size and then reads the file data into it, overflowing the heap.

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.

Medical imaging software talks over a network protocol called DICOM. A server reads a number from the client that says how big a message may be, and uses it to reserve memory. If the number is near the maximum, adding a small amount wraps around to a tiny value, so the program writes far more data than it reserved, damaging memory and possibly letting 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 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.