CVE-2021-41688

7.5 HIGH

📋 TL;DR

CVE-2021-41688 is a double-free vulnerability in DCMTK's dcmqrdb program that allows attackers to cause denial of service by sending specific requests. This affects systems running DCMTK up to version 3.6.6, particularly healthcare and medical imaging systems using DICOM protocols.

💻 Affected Systems

Products:
  • DCMTK (DICOM Toolkit)
Versions: All versions through 3.6.6
Operating Systems: Linux, Windows, macOS, Unix-like systems
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems running dcmqrdb service; other DCMTK components are not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service disruption of DICOM query services, potentially affecting medical imaging workflows and patient care systems.

🟠

Likely Case

Service crashes and instability in dcmqrdb processes, requiring manual restarts and causing temporary service interruptions.

🟢

If Mitigated

Minimal impact with proper network segmentation and monitoring; crashes would be contained and quickly detected.

🌐 Internet-Facing: MEDIUM - While exploit requires specific requests, exposed dcmqrdb services could be targeted for DoS attacks.
🏢 Internal Only: LOW - Requires network access to dcmqrdb service and knowledge of specific triggering requests.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires sending specific malformed requests to dcmqrdb service; no authentication needed but requires network access to the service.

🛠️ 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 3.6.6 or apply commit a9697dfeb672b0b9412c00c7d36d801e27ec85cb. 2. Recompile dcmqrdb from source. 3. Restart dcmqrdb service. 4. Verify service is running with patched version.

🔧 Temporary Workarounds

Network Access Restriction

linux

Restrict network access to dcmqrdb service to trusted sources only

iptables -A INPUT -p tcp --dport [dcmqrdb_port] -s [trusted_network] -j ACCEPT
iptables -A INPUT -p tcp --dport [dcmqrdb_port] -j DROP

Service Monitoring and Restart

linux

Implement monitoring and automatic restart for dcmqrdb service

systemctl enable dcmqrdb
systemctl start dcmqrdb
Add to monitoring: check process dcmqrdb and restart if down

🧯 If You Can't Patch

  • Disable dcmqrdb service if not required for operations
  • Implement strict network segmentation and firewall rules to limit access to dcmqrdb service

🔍 How to Verify

Check if Vulnerable:

Check DCMTK version: dcmqrdb --version or check installed package version. If version is 3.6.6 or earlier, system is vulnerable.

Check Version:

dcmqrdb --version 2>&1 | grep Version || dpkg -l | grep dcmtk || rpm -qa | grep dcmtk

Verify Fix Applied:

Verify dcmqrdb is running patched version and test with normal DICOM queries to ensure service stability.

📡 Detection & Monitoring

Log Indicators:

  • dcmqrdb process crashes or abnormal terminations
  • Multiple connection attempts with malformed DICOM queries
  • Service restart patterns in system logs

Network Indicators:

  • Unusual traffic patterns to dcmqrdb port (default 11112)
  • Multiple rapid connections to dcmqrdb service
  • Malformed DICOM request packets

SIEM Query:

source="dcmqrdb.log" AND ("segmentation fault" OR "double free" OR "aborted" OR "crash")

🔗 References

📤 Share & Export