CVE-2020-9480
📋 TL;DR
This vulnerability allows attackers to bypass authentication in Apache Spark's standalone resource manager and execute arbitrary shell commands on the host machine. It affects Apache Spark 2.4.5 and earlier versions when using standalone resource manager with authentication enabled. Other resource managers like YARN and Mesos are not affected.
💻 Affected Systems
- Apache Spark
📦 What is this software?
Spark by Apache
⚠️ Risk & Real-World Impact
Worst Case
Full remote code execution on Spark master nodes, allowing complete compromise of the cluster and potential lateral movement to other systems.
Likely Case
Unauthorized application deployment leading to resource consumption, data exfiltration, or malicious code execution within the cluster.
If Mitigated
Limited impact if proper network segmentation and access controls prevent external access to Spark master ports.
🎯 Exploit Status
Exploit requires network access to Spark master port (default 7077) and knowledge of the vulnerability. Public exploit code exists in security advisories.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Apache Spark 2.4.6 and later
Vendor Advisory: https://spark.apache.org/security.html#CVE-2020-9480
Restart Required: Yes
Instructions:
1. Upgrade to Apache Spark 2.4.6 or later. 2. Download from official Apache Spark website. 3. Replace existing Spark installation. 4. Restart all Spark services including master and workers.
🔧 Temporary Workarounds
Disable standalone resource manager authentication
allRemove spark.authenticate configuration to prevent exploitation, though this reduces security.
Remove or comment out spark.authenticate=true in spark-defaults.conf
Network isolation
linuxRestrict access to Spark master port (default 7077) to trusted networks only.
iptables -A INPUT -p tcp --dport 7077 -s trusted_network -j ACCEPT
iptables -A INPUT -p tcp --dport 7077 -j DROP
🧯 If You Can't Patch
- Implement strict network access controls to limit access to Spark master port (7077) to only trusted administrative networks.
- Monitor for unusual RPC requests or unauthorized application submissions in Spark logs.
🔍 How to Verify
Check if Vulnerable:
Check Spark version: if using standalone resource manager with spark.authenticate enabled and version ≤2.4.5, system is vulnerable.
Check Version:
spark-submit --version 2>&1 | grep version
Verify Fix Applied:
Verify Spark version is 2.4.6 or later and test authentication by attempting to submit jobs without proper credentials.
📡 Detection & Monitoring
Log Indicators:
- Unauthorized RPC requests to master
- Application submissions without proper authentication tokens
- Unexpected shell command execution in master logs
Network Indicators:
- Unusual RPC traffic to port 7077 from untrusted sources
- Application submission requests without preceding authentication handshake
SIEM Query:
source="spark-master.log" AND ("authentication failed" OR "unauthorized RPC" OR "malformed request")
🔗 References
- https://lists.apache.org/thread.html/r03ad9fe7c07d6039fba9f2152d345274473cb0af3d8a4794a6645f4b%40%3Cuser.spark.apache.org%3E
- https://lists.apache.org/thread.html/ra0e62a18ad080c4ce6df5e0202a27eaada75222761efc3f7238b5a3b%40%3Ccommits.doris.apache.org%3E
- https://lists.apache.org/thread.html/rb3956440747e41940d552d377d50b144b60085e7ff727adb0e575d8d%40%3Ccommits.submarine.apache.org%3E
- https://lists.apache.org/thread.html/ree9e87aae81852330290a478692e36ea6db47a52a694545c7d66e3e2%40%3Cdev.spark.apache.org%3E
- https://spark.apache.org/security.html#CVE-2020-9480
- https://www.oracle.com/security-alerts/cpuApr2021.html
- https://lists.apache.org/thread.html/r03ad9fe7c07d6039fba9f2152d345274473cb0af3d8a4794a6645f4b%40%3Cuser.spark.apache.org%3E
- https://lists.apache.org/thread.html/ra0e62a18ad080c4ce6df5e0202a27eaada75222761efc3f7238b5a3b%40%3Ccommits.doris.apache.org%3E
- https://lists.apache.org/thread.html/rb3956440747e41940d552d377d50b144b60085e7ff727adb0e575d8d%40%3Ccommits.submarine.apache.org%3E
- https://lists.apache.org/thread.html/ree9e87aae81852330290a478692e36ea6db47a52a694545c7d66e3e2%40%3Cdev.spark.apache.org%3E
- https://spark.apache.org/security.html#CVE-2020-9480
- https://www.oracle.com/security-alerts/cpuApr2021.html