Junglewise Threat Intelligence

CVE-2026-12805: OFFIS DCMTK heap overflow in XMLNode::parseFile

CVE-2026-12805 · Severity: medium · CVSS 6.3 · Published 2026-06-21

Technologies: OFFIS DCMTK Toolkit. Vendors: OFFIS.

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