CVE-2021-41690
📋 TL;DR
CVE-2021-41690 is a memory leak vulnerability in DCMTK's dcmqrdb program where allocated memory for file information isn't properly freed. Attackers can send specific requests to cause memory exhaustion, leading to denial of service. Organizations using DCMTK for medical imaging DICOM services are affected.
💻 Affected Systems
- DCMTK (DICOM Toolkit)
📦 What is this software?
Dcmtk by Offis
⚠️ Risk & Real-World Impact
Worst Case
Complete service outage of DICOM services due to memory exhaustion, potentially disrupting medical imaging workflows and patient care.
Likely Case
Degraded performance or temporary unavailability of DCMTK services requiring restart of affected processes.
If Mitigated
Minimal impact with proper monitoring and resource limits in place, though service may still require occasional restarts.
🎯 Exploit Status
Exploitation requires sending specific requests to dcmqrdb, which is straightforward for attackers familiar with DICOM protocols.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Fixed in commit a9697dfeb672b0b9412c00c7d36d801e27ec85cb and later versions
Vendor Advisory: https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb
Restart Required: Yes
Instructions:
1. Update DCMTK to version after commit a9697dfeb672b0b9412c00c7d36d801e27ec85cb. 2. Rebuild from source if using custom builds. 3. Restart all dcmqrdb services.
🔧 Temporary Workarounds
Resource Limiting
linuxLimit memory usage of dcmqrdb process using OS controls
ulimit -v [MEMORY_LIMIT] && dcmqrdb
systemctl set-property dcmqrdb.service MemoryMax=[VALUE]
Network Restriction
linuxRestrict access to dcmqrdb service to trusted networks only
iptables -A INPUT -p tcp --dport [DCMQRDB_PORT] -s [TRUSTED_NETWORK] -j ACCEPT
iptables -A INPUT -p tcp --dport [DCMQRDB_PORT] -j DROP
🧯 If You Can't Patch
- Implement strict network segmentation to isolate dcmqrdb from untrusted networks
- Deploy monitoring with alerts for abnormal memory consumption by dcmqrdb processes
🔍 How to Verify
Check if Vulnerable:
Check DCMTK version: dcmdump --version | grep 'OFFIS DCMTK' and verify if version is 3.6.6 or earlier
Check Version:
dcmdump --version 2>&1 | grep 'OFFIS DCMTK'
Verify Fix Applied:
Verify commit hash includes a9697dfeb672b0b9412c00c7d36d801e27ec85cb or version is newer than 3.6.6
📡 Detection & Monitoring
Log Indicators:
- Rapid increase in dcmqrdb memory usage
- Process restart messages
- Out of memory errors in system logs
Network Indicators:
- Unusual volume of DICOM requests to dcmqrdb port
- Requests with malformed or specially crafted DICOM data
SIEM Query:
process_name="dcmqrdb" AND (memory_usage > [THRESHOLD] OR event_type="process_restart")
🔗 References
- https://github.com/DCMTK/dcmtk
- https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb
- https://lists.debian.org/debian-lts-announce/2024/06/msg00022.html
- https://github.com/DCMTK/dcmtk
- https://github.com/DCMTK/dcmtk/commit/a9697dfeb672b0b9412c00c7d36d801e27ec85cb
- https://lists.debian.org/debian-lts-announce/2024/06/msg00022.html
- https://lists.debian.org/debian-lts-announce/2025/01/msg00032.html