Skip to content
Memory corruption Advisory Advanced CVE-2024-24793CVE-2024-24794

Imaging Data Commons libdicom DICOM File Meta Information Parsing Use-After-Free vulnerabilities

A use-after-free vulnerability in libdicom 1.0.5 occurs when parsing DICOM files with duplicate tags in the File Meta Information header or duplicate sequence tags, leading to double-free and potential memory corruption. An attacker could exploit this by inducing the application to process a malicious DICOM image, possibly achieving arbitrary code execution.

Dimitrios Tatsis Follow

Originally disclosed on Cisco Talos

High 8.1 View original

A use-after-free vulnerability exists in the DICOM Element Parsing as implemented in Imaging Data Commons libdicom 1.0.5. A specially crafted DICOM file can cause premature freeing of memory that is used later.

Dimitrios Tatsis, 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 function dcm_dataset_insert frees the element when a duplicate tag is found and returns false, causing the caller to free the same element again.

Impact

A crafted DICOM file could cause a crash and potentially allow arbitrary code execution, though the CVSS score indicates high attack complexity.

What the attacker needed

Victim processes a malicious DICOM file

The fix

The vendor has issued a fix on GitHub.

How it was found

  1. Craft a DICOM file with two elements having the same tag in the File Meta Information header.
  2. Open the file with a vulnerable application using libdicom.
  3. The library parses the file and triggers the double-free, leading to a crash or potential code execution.

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.

A use-after-free happens when a program frees memory but then keeps using it, like deleting a file and then trying to open it. Here, the library frees an object twice because of a mistake in error handling, which can crash the program or let an attacker run their own code. The attacker only needs to craft a special image file that the victim opens.

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 Dimitrios Tatsis

View all

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