CVE-2026-125130 — OFFIS DCMTK Toolkit — CWE-862
An unauthenticated attacker could delete stored objects from a read-only storage area and insert different objects in their place.
An unauthenticated attacker could delete stored objects from a read-only storage area and insert different objects in their place.
🎯 What is this vulnerability?
CVE‑2026‑125130 affects the OFFIS DCMTK Toolkit 3.7.0 (the open‑source DICOM implementation used by many PACS, modality, and viewer products).
- Vulnerability class – CWE‑862 (Missing Authorization) The DCMTK storage service (the Storage SCP that accepts incoming C‑STORE requests) does not verify that the caller is authorised to modify the file system location that has been configured as read‑only for stored DICOM objects.
- Technical flaw 1. When a DICOM association is established, the Storage SCP accepts any C‑STORE request that contains a valid SOP Instance UID, regardless of the client’s identity. 2. The code that writes the incoming payload to disk calls
- Delete any stored DICOM object (availability impact).
- Insert a crafted DICOM object in its place (integrity impact).
OFStandard::deleteFile() (or the equivalent std::remove) without first checking the caller’s privileges.
3. After the deletion succeeds, the same code writes the new payload to the same path, effectively replacing the original object.
4. Because the storage directory is supposed to be read‑only (e.g., mounted with ro or protected by OS ACLs), the expectation is that only privileged processes may write there. DCMTK bypasses those expectations by performing the delete/write as the process user, which is typically a service account that has write permission on the mount point (the mount‑point may be read‑only for normal users but the service runs with elevated rights).The result is an unauthenticated attacker who can:
No confidentiality impact is reported because the attacker does not gain access to the content of other objects; they merely replace or remove them.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All commands are illustrative – the exact network address, port, and AE titles will differ per deployment.
1. Discovery & Reconnaissance
| Step | Technique | Details |
|---|---|---|
| 1.1 | Port scanning | Scan the target network for open DICOM ports (default TCP 104, sometimes 11112). Example: nmap -p 104,11112 <IP> |
| 1.2 | Banner / Association probing | Use echoscu (part of DCMTK) or dcmqrscp to perform an *Association Request* and capture the *Implementation Class UID* and *Implementation Version Name* returned in the A‑ASSOCIATE‑AC. Example: <br>echoscu --aetitle TEST --call <TARGET_AET> <IP> 104 <br> The response will contain something like Implementation Version Name: DCMTK 3.7.0 which confirms the vulnerable version. |
| 1.3 | Version confirmation | If the target replies with DCMTK 3.7.0 (or a later sub‑release that is known to be vulnerable), the attacker proceeds. Otherwise they abort. |
2. Exploitation
The attacker uses the standard DCMTK client storescu (or any DICOM library capable of C‑STORE) to send a malicious C‑STORE that re‑uses the SOP Instance UID of an existing object.
Note: The DICOM protocol does not have a dedicated “delete” command. DCMTK’s Storage SCP treats a C‑STORE with a duplicate SOP Instance UID as a replace operation, and because it performs an unconditional deleteFile() before writing, the original file is removed first.2.1 Prepare a malicious DICOM file
# Create a minimal DICOM file with the same SOP Instance UID as the target object
# (Replace <TARGET_UID> with the UID you want to replace)
dcmodify \
--insert "PatientName=Attacker^Hacker" \
--replace "SOPInstanceUID=<TARGET_UID>" \
original.dcm \
-o malicious.dcm2.2 Send the replacement C‑STORE
# storescu is the DCMTK command‑line C‑STORE client
storescu \
--aetitle ATTACKER \
--call TARGET_AE \
<IP> 104 \
malicious.dcmWhat happens on the server side?
1. The Storage SCP receives the C‑STORE request.
2. It extracts the SOP Instance UID (<TARGET_UID>).
3. It builds the file path (e.g., /var/dicom/storage/<TARGET_UID>.dcm).
4. Missing authorization check → it calls deleteFile() on the existing file.
5. It writes malicious.dcm to the same path.
If the attacker wishes to delete an object without replacement, they can send a zero‑byte DICOM file (or a file that contains only the mandatory meta‑header) – the server will still delete the original before writing the empty payload, effectively removing the object.
3. Post‑Exploitation
| Goal | How it is achieved |
|---|---|
| Integrity breach | The attacker can replace a diagnostic image (e.g., a CT scan) with a fabricated one, potentially influencing clinical decisions. |
| Denial‑of‑Service | By repeatedly sending C‑STORE requests with duplicate UIDs and empty payloads, the attacker can delete large numbers of studies, causing loss of availability. |
| Persistence / Lateral movement | If the replaced DICOM object contains a malicious payload (e.g., a script embedded in a private tag that is later executed by a vulnerable viewer), the attacker can achieve code execution on workstations that automatically process the file. This is *scenario‑dependent* but technically feasible. |
🌍 Real‑World Impact
| CIA Triad | CVSS Vector Interpretation | Practical Consequence |
|---|---|---|
| Confidentiality (C:N) | C:N – No direct data disclosure. | Patient data remains confidential, but the attacker can hide the fact that data has been tampered with. |
| Integrity (I:H) | I:H – Complete loss of integrity. | Medical images or reports can be silently altered, leading to misdiagnosis, legal liability, and loss of trust. |
| Availability (A:H) | A:H – Complete loss of availability. | Deleting large numbers of objects can render a PACS unusable, halting radiology workflows. |
| Overall | Critical (9.1) – Network‑reachable, no authentication, low complexity, no user interaction. | A remote attacker on the hospital network (or any network segment that can reach the DICOM port) can cause immediate, high‑impact damage without needing credentials. |
Typical affected environments:
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Action | Details |
|---|---|
| Upgrade | Move to DCMTK 3.7.1 (or any later release) where the Storage SCP now performs an explicit authorization check (checkWritePermission()) before invoking deleteFile(). OFFIS released this version on 2026‑12‑15 (official release notes: “Fixed CVE‑2026‑125130 – missing authorization on storage replace/delete”). |
| If upgrade is not possible | Apply the vendor‑supplied patch for 3.7.0 (named dcmtk-3.7.0-patch1). The patch adds a call to OFStandard::fileExists() and aborts the operation when the target directory is marked read‑only in the configuration file (dcmtk.cfg). |
2. Immediate Work‑arounds
| Mitigation | How to implement |
|---|---|
| Network segmentation | Restrict inbound traffic to the DICOM port (104/TCP) to only trusted IP ranges (e.g., internal imaging LAN). Use firewalls or ACLs on the host (iptables -A INPUT -p tcp --dport 104 -s <trusted‑subnet> -j ACCEPT). |
| Run DCMTK under a non‑privileged user | Create a dedicated service account (dcmtksvc) with read‑only permissions on the storage directory (chmod 0555 /var/dicom/storage). The service account must not have write rights; the only write path should be a temporary “incoming” directory that a separate, authorised process moves files from after validation. |
| Filesystem‑level protection | Mount the storage directory with the nosuid,nodev,noexec,ro options and use a bind mount for a write‑able staging area. Example in /etc/fstab:<br>/dev/sdb1 /var/dicom/storage ext4 ro,bind 0 0<br>/dev/sdb1 /var/dicom/incoming ext4 rw,bind 0 0 |
| Application‑level ACL | If the OS supports POSIX ACLs, deny write/delete for the DCMTK process user on the final storage path: <br>setfacl -m u:dcmtksvc:rx /var/dicom/storage |
| DICOM‑level access control | Enable the optional *Association ACL* feature in DCMTK (--require-aetitle and --allowed-aetitles) so that only known AE titles can establish an association. This does not replace the missing authorization check but reduces the attack surface. |
| IDS/IPS signatures | Deploy a DICOM‑aware IDS (e.g., Suricata with the dcm protocol parser) and create a rule that alerts on duplicate SOP Instance UID within a short time window: <br>alert dcm any any -> any 104 (msg:"DCMTK duplicate SOP UID – possible CVE‑2026‑125130 exploit"; dcm.sop_instance_uid; flow:to_server,established; sid:20261001; rev:1;) |
3. Detection – Log & Network Indicators
| Source | Indicator | Example |
|---|---|---|
DCMTK server logs (if --debug or --log-level info is enabled) | “Received C‑STORE request for SOP Instance UID \<UID\> – overwriting existing file” | 2026-11-30 12:45:12.345 INFO [storescp] Received C-STORE for SOPInstanceUID=1.2.840.113619.2.55.3.604688.12345 – overwriting existing file |
| System audit (Linux auditd) | unlink or rename syscalls on files under /var/dicom/storage performed by the DCMTK process user | type=SYSCALL msg=audit(1701365112.123:456): arch=c000003e syscall=87 success=yes exit=0 a0=0x7f9c1c0c0000 a1=0x0 a2=0x0 a3=0x0 items=1 pid=3124 auid=0 uid=1001 gid=1001 exe="/usr/bin/dcmqrscp" path="/var/dicom/storage/1.2.840.113619.2.55.3.604688.12345.dcm" |
| Network IDS | Repeated C‑STORE PDUs with the same SOP Instance UID within < 5 seconds | Suricata rule (see above) triggers an alert. |
| File integrity monitoring | Unexpected changes in hash of files under the storage directory (e.g., sha256sum mismatch) | 2026-12-01 08:12:33 WARN FIM: /var/dicom/storage/1.2.840.113619.2.55.3.604688.12345.dcm hash changed (expected: a3f5… got: 9b2e…) |
⚠️ Urgency
storescu, echoscu) are part of the default DCMTK distribution and are freely available. No special privileges are needed on the attacker side. Patch priority: Urgent – Deploy the fix within 48 hours for any system that:
Bottom line: CVE‑2026‑125130 is a classic “missing authorization” flaw that turns a read‑only DICOM archive into a writeable one for anyone who can reach the DICOM port. The attack requires only a standard DCMTK client, making it trivially exploitable. Prompt patching (or the described mitigations) is essential to preserve the integrity and availability of medical imaging data.
[🤖 CVE Professor AI Security Engine]
FOFA Query