CVE-2021-40903
📋 TL;DR
CVE-2021-40903 is an authentication bypass vulnerability in Antminer Monitor 0.50.0 due to a static secret string in Flask server settings instead of random generation. This allows attackers to bypass authentication and gain unauthorized access to the monitoring interface. Anyone running Antminer Monitor 0.50.0 with default configuration is affected.
💻 Affected Systems
- Antminer Monitor
📦 What is this software?
Antminer Monitor by Antminer Monitor Project
⚠️ Risk & Real-World Impact
Worst Case
Complete compromise of the Antminer monitoring system, allowing attackers to reconfigure mining operations, steal cryptocurrency, or use the system as an entry point to the network.
Likely Case
Unauthorized access to monitor and potentially control connected Antminer devices, leading to mining disruption or configuration changes.
If Mitigated
Limited impact if system is isolated from internet and has strict network controls, though authentication bypass remains possible locally.
🎯 Exploit Status
Exploit requires network access to the Flask server. Public exploit code demonstrates simple authentication bypass using the static secret.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Not available
Vendor Advisory: Not available
Restart Required: No
Instructions:
No official patch exists. Upgrade to a newer version if available, or implement workarounds.
🔧 Temporary Workarounds
Modify Flask Secret Key
linuxChange the static secret key in settings.py to a randomly generated secure value
sed -i "s/SECRET_KEY = 'static-secret'/SECRET_KEY = '$(openssl rand -hex 32)'/g" settings.py
Implement Network Access Controls
linuxRestrict access to the Flask server to trusted IP addresses only
iptables -A INPUT -p tcp --dport 5000 -s trusted_ip -j ACCEPT
iptables -A INPUT -p tcp --dport 5000 -j DROP
🧯 If You Can't Patch
- Isolate the Antminer Monitor system from internet and restrict internal network access
- Implement additional authentication layer (e.g., reverse proxy with authentication)
🔍 How to Verify
Check if Vulnerable:
Check if Antminer Monitor version is 0.50.0 and examine settings.py for static SECRET_KEY value
Check Version:
Check version in application interface or configuration files
Verify Fix Applied:
Verify SECRET_KEY in settings.py has been changed from default and is a random value
📡 Detection & Monitoring
Log Indicators:
- Unauthorized access attempts
- Authentication bypass logs
- Unexpected configuration changes
Network Indicators:
- Unusual traffic to Flask server port (default 5000)
- Requests with crafted authentication tokens
SIEM Query:
source="antminer-monitor" AND (event="auth_failure" OR event="config_change")
🔗 References
- https://github.com/anselal/antminer-monitor
- https://packetstormsecurity.com/files/164048/Antminer-Monitor-0.5.0-Authentication-Bypass.html
- https://www.exploit-db.com/exploits/50267
- https://github.com/anselal/antminer-monitor
- https://packetstormsecurity.com/files/164048/Antminer-Monitor-0.5.0-Authentication-Bypass.html
- https://www.exploit-db.com/exploits/50267