CVE-2021-42343
📋 TL;DR
This vulnerability in Dask distributed package allows remote code execution when Dask clusters are configured to listen on external interfaces instead of localhost only. It affects users running single-machine Dask clusters with LocalCluster or Client defaults. Sophisticated attackers can exploit exposed ports to execute arbitrary code on vulnerable systems.
💻 Affected Systems
- Dask distributed package for Python
📦 What is this software?
Dask by Anaconda
⚠️ Risk & Real-World Impact
Worst Case
Full system compromise with remote code execution leading to data theft, lateral movement, and complete control of affected systems.
Likely Case
Unauthorized access to Dask worker processes enabling data exfiltration, resource hijacking for cryptocurrency mining, or deployment of additional malware.
If Mitigated
Limited impact with proper network segmentation and firewall rules preventing external access to Dask worker ports.
🎯 Exploit Status
Exploitation requires network access to exposed Dask worker ports. The vulnerability is well-documented in security advisories.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 2021.10.0 and later
Vendor Advisory: https://github.com/dask/distributed/security/advisories/GHSA-hwqr-f3v9-hwxr
Restart Required: Yes
Instructions:
1. Update Dask distributed package using pip: pip install --upgrade dask-distributed>=2021.10.0
2. Restart all Dask clusters and worker processes
3. Verify the fix by checking that workers only bind to localhost
🔧 Temporary Workarounds
Explicitly bind to localhost
allConfigure Dask clusters to bind only to localhost interface
from dask.distributed import LocalCluster, Client
cluster = LocalCluster(host='127.0.0.1')
client = Client(cluster)
Firewall blocking
linuxBlock external access to Dask worker ports using firewall rules
# Linux iptables example
iptables -A INPUT -p tcp --dport 30000:50000 -j DROP
# Adjust port range based on your Dask configuration
🧯 If You Can't Patch
- Implement strict network segmentation to isolate Dask clusters from untrusted networks
- Configure host-based firewalls to block all external access to Dask worker ports
🔍 How to Verify
Check if Vulnerable:
Check Dask distributed version: python -c "import distributed; print(distributed.__version__)" and verify if <2021.10.0. Also check if Dask workers are listening on external interfaces using netstat or ss commands.
Check Version:
python -c "import distributed; print('Dask distributed version:', distributed.__version__)"
Verify Fix Applied:
After patching, verify version is >=2021.10.0 and confirm Dask workers only bind to localhost (127.0.0.1) using netstat -tulpn or ss -tulpn.
📡 Detection & Monitoring
Log Indicators:
- Unexpected external connections to Dask worker ports
- Unauthorized access attempts to Dask cluster endpoints
Network Indicators:
- External traffic to high ports (typically 30000-50000) where Dask workers run
- Unusual outbound connections from Dask worker processes
SIEM Query:
source_ip IN (external_ips) AND dest_port BETWEEN 30000 AND 50000 AND protocol=tcp
🔗 References
- https://docs.dask.org/en/latest/changelog.html
- https://github.com/dask/dask/tags
- https://github.com/dask/distributed/security/advisories/GHSA-hwqr-f3v9-hwxr
- https://docs.dask.org/en/latest/changelog.html
- https://github.com/dask/dask/tags
- https://github.com/dask/distributed/security/advisories/GHSA-hwqr-f3v9-hwxr