CVE-2024-34509
Executive Summary
CVE-2024-34509 is a denial-of-service (DoS) vulnerability in the dcmdata module of DCMTK, an open-source DICOM toolkit. The flaw manifests as a segmentation fault when processing a malformed DIMSE message. An unauthenticated attacker can exploit this by sending a specially crafted DICOM message to a vulnerable DCMTK service, causing the application to crash. This vulnerability affects DCMTK versions prior to 3.6.9. No public proof-of-concept (PoC) or exploit code is currently available. The vulnerability is classified under CWE-476 (NULL Pointer Dereference).
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
DCMTK is a widely used library in medical imaging software. Organizations using DCMTK in their software supply chain should verify they are using version 3.6.9 or later. The vulnerability is in the core dcmdata library, which is used for parsing DICOM data sets and messages. Any application that uses DCMTK to receive or process DIMSE messages is potentially affected.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0 in the NVD data, which is likely a placeholder. Based on the vulnerability description (segmentation fault via an invalid DIMSE message), a reasonable CVSS v3.1 vector would be:
- Attack Vector (AV): Network (N) – The attack is sent over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): None (N) – No user action required.
- Scope (S): Unchanged (U) – The crash affects only the vulnerable component.
- Confidentiality (C): None (N) – No data exposure.
- Integrity (I): None (N) – No data modification.
- Availability (A): High (H) – The service becomes unavailable.
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Base Score: 7.5 (High)
Threat Level: High. The vulnerability is remotely exploitable with low complexity and no authentication, leading to a denial of service.
Deep Dive & Mechanics
The vulnerability resides in the dcmdata module of DCMTK, specifically in the handling of DIMSE (DICOM Message Service Element) messages. DIMSE is the protocol used for communication between DICOM applications.
The segmentation fault occurs when the software attempts to dereference a NULL pointer while parsing a malformed DIMSE message. This is a classic NULL pointer dereference (CWE-476). The exact code path is in the parsing logic that handles the command set of a DICOM message. When the message is crafted in a way that causes the parser to encounter an unexpected or missing data element, it fails to properly initialize a pointer before using it, leading to a crash.
The vulnerability is triggered by sending an invalid DIMSE message to a DCMTK service that listens for DICOM associations (typically on port 11112). The crash is immediate and does not require any special privileges or user interaction.
Vulnerable vs. Patched Code
The fix in DCMTK 3.6.9 likely involves adding a NULL check before dereferencing a pointer in the DIMSE message parsing code. While the exact patch is not publicly available in the provided data, the general pattern is:
Vulnerable Code (Conceptual):
// In dcmdata/libsrc/dcdatset.cc or similar
void parseDIMSECommand(DcmDataset *dataset) {
DcmElement *element = dataset->getNextElement();
// No NULL check
element->getValue(...); // Segmentation fault if element is NULL
}
Patched Code (Conceptual):
void parseDIMSECommand(DcmDataset *dataset) {
DcmElement *element = dataset->getNextElement();
if (element == NULL) {
// Handle error gracefully
return;
}
element->getValue(...);
}
The patched version ensures that pointers are validated before use, preventing the segmentation fault.
Exploitation & Lab Setup
Red Team (Exploitation)
Objective: Cause a denial of service on a DCMTK service.
Lab Setup:
- Target: A machine running DCMTK version 3.6.8 or earlier with a DICOM service listening (e.g.,
dcmqrscporstorescp). - Attacker: A machine with Python and the
pynetdicomlibrary installed.
Exploitation Steps:
- Craft a malformed DIMSE message. The exact payload is not publicly known, but the general approach is to send a DICOM C-ECHO request with a corrupted command set.
- Send the message to the target's DICOM port (default 11112).
Example Python Script (Conceptual):
import socket
def send_malformed_dimse(target_ip, target_port=11112):
# Craft a malformed DICOM message (example - actual payload may vary)
# This is a placeholder for the actual exploit payload
malformed_payload = b"\x01\x00\x00\x00" + b"\x00" * 100 # Invalid DIMSE message
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((target_ip, target_port))
sock.send(malformed_payload)
sock.close()
if __name__ == "__main__":
send_malformed_dimse("192.168.1.100")
Expected Result: The DCMTK service crashes, becoming unavailable.
Blue Team (Defense)
Detection:
- Network Monitoring: Monitor for malformed DICOM messages on port 11112. Look for packets that do not conform to the DICOM standard.
- Application Logs: Enable verbose logging on DCMTK services. Look for error messages related to "segmentation fault", "NULL pointer", or "invalid DIMSE message".
- System Monitoring: Monitor for crashes of DCMTK processes (e.g.,
dcmqrscp,storescp).
Mitigation:
- Patch: Upgrade to DCMTK 3.6.9 or later.
- Network Segmentation: Restrict access to DICOM services to trusted IP addresses only.
- Intrusion Prevention System (IPS): Deploy signatures to detect and block malformed DICOM messages.
Indicators of Compromise (IOCs)
- Network IOCs:
- Inbound TCP connections to port 11112 with malformed DICOM payloads.
- Packets with invalid DICOM command set structures.
- System IOCs:
- Core dumps from DCMTK processes (e.g.,
core.dcmqrscp). - Log entries containing "Segmentation fault" or "SIGSEGV" from DCMTK processes.
- Unexpected termination of DCMTK services.
- Core dumps from DCMTK processes (e.g.,
Detection Engineering
YARA Rule
rule CVE_2024_34509_DCMTK_DIMSE_CRASH {
meta:
description = "Detects malformed DIMSE messages targeting DCMTK CVE-2024-34509"
author = "Valters IT"
date = "2024-10-27"
reference = "CVE-2024-34509"
strings:
$dimse_header = { 01 00 00 00 } // Example DIMSE header pattern
$null_trigger = { 00 00 00 00 00 00 00 00 } // Potential NULL pointer trigger
condition:
$dimse_header at 0 and $null_trigger
}
Sigma Rule
title: DCMTK DIMSE Crash Exploit Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects network traffic attempting to exploit CVE-2024-34509 in DCMTK
author: Valters IT
date: 2024/10/27
logsource:
category: network_connection
product: suricata
detection:
selection:
dest_port: 11112
payload|contains: "01000000" # Hex representation of malformed DIMSE header
condition: selection
falsepositives:
- Legitimate DICOM traffic with similar patterns (rare)
level: high
Suricata Rule
alert tcp any any -> any 11112 (msg:"CVE-2024-34509 DCMTK DIMSE Crash Attempt"; flow:to_server,established; content:"|01 00 00 00|"; depth:4; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade DCMTK: Update to version 3.6.9 or later. This is the only confirmed fix.
- Restrict Network Access: Use firewall rules to limit access to DICOM ports (11112) to only trusted IP addresses.
- Monitor for Crashes: Implement monitoring to detect unexpected termination of DCMTK services.
Long-Term Measures:
- Input Validation: Ensure that any application using DCMTK validates DICOM messages before processing.
- Regular Updates: Keep DCMTK and all dependencies up to date.
- Security Audits: Conduct regular security audits of medical imaging infrastructure.
Workarounds (if patching is not immediately possible):
- Disable DICOM services if not required.
- Use a reverse proxy or application-layer firewall to filter malformed DICOM messages.
Valters IT
DevSecOps & Cyber Threat Intelligence