Accusoft ImageGear DICOM parse_dicom_meta_info integer overflow vulnerability
An integer overflow in the DICOM metadata parsing function of Accusoft ImageGear 19.9 allows a crafted file to bypass a buffer size check, leading to a stack-based buffer overflow. An attacker could exploit this to achieve remote code execution.
Originally disclosed on Cisco Talos
An integer overflow vulnerability exists in the DICOM parsedicommetainfo functionality of Accusoft ImageGear 19.9. A specially crafted malformed file can lead to a stack-based buffer overflow.
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 an integer overflow when adding 2 to a size field read from the file, causing a buffer size check to pass incorrectly and leading to a stack buffer overflow.
Impact
A stack-based buffer overflow could lead to remote code execution.
What the attacker needed
Victim opens a crafted DICOM file
How it was found
- Craft a DICOM file with a tag whose size field is set to 0xFFFFFFFF.
- Load the malformed DICOM file in a program using Accusoft ImageGear 19.9.
- The parser reads the size and adds 2, causing an integer overflow.
- The size check incorrectly passes, so no larger buffer is allocated.
- The parser writes data into the fixed-size stack buffer, overflowing it.
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.
This report describes a bug in a library that reads DICOM image files. When the file claims a certain size, the program adds 2 to it, but that addition can wrap around to a small number, so a safety check passes and the program writes too much data into a small buffer on the stack. That can crash the program or let 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.