Executive brief
OFFIS DCMTK is a widely used collection of libraries and applications implementing the DICOM standard for medical imaging. A vulnerability in its XML parsing component allows an attacker to cause a system crash or potentially execute unauthorized code by providing a specially crafted input, such as a named pipe. This could disrupt medical imaging workflows or compromise the integrity of systems processing clinical documents.
Technical details
A heap-based buffer overflow exists in XMLNode::parseFile() within ofstd/libsrc/ofxml.cc. The vulnerability occurs because the code fails to validate the return value of ftell() when processing input. When a non-seekable file (such as a FIFO/named pipe) is used, ftell() returns -1. The application subsequently uses this value to allocate a small 3-byte buffer via malloc(-1 + 4) and then attempts to read a massive amount of data (SIZE_MAX bytes) into that buffer via fread(), leading to a heap overflow. This can be triggered remotely if an application using DCMTK (like cda2dcm) processes externally provided file paths or data streams. A patch has been released in commit 1d4b3815c0987840a983160bfc671fef63a3105b.
Affected products
- OFFIS DCMTK 3.0 through 3.7.0
Timeline
- 2026-05-16: disclosed: Vulnerability reported to vendor by researchers from Instituto Tecnológico de Costa Rica.
- 2026-05-19: other: Issue tracked in vendor Redmine as #1208.
- 2026-05-23: patched: Fix committed to DCMTK repository.
- 2026-06-21: advisory: CVE-2026-12805 published.
References
- https://git.dcmtk.org/?p=dcmtk.git;a=commit;h=1d4b3815c0987840a983160bfc671fef63a3105b
- https://github.com/DCMTK/dcmtk/commit/1d4b3815c0987840a983160bfc671fef63a3105b
- https://medium.com/@faboherrera.fabo/dcmtk-vulnerability-report-201afc687790
- https://support.dcmtk.org/redmine/issues/1208
- https://vuldb.com/cve/CVE-2026-12805
- https://vuldb.com/submit/836273
- https://vuldb.com/vuln/372599