CVE-2020-7384
📋 TL;DR
CVE-2020-7384 is a command injection vulnerability in Rapid7's Metasploit msfvenom framework that allows attackers to execute arbitrary commands on systems processing malicious APK files. This affects users who run msfvenom with APK templates, particularly penetration testers and security researchers. The vulnerability exists in how APK files are handled during payload generation.
💻 Affected Systems
- Rapid7 Metasploit Framework
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Full system compromise with remote code execution leading to data theft, lateral movement, or complete system takeover.
Likely Case
Local privilege escalation or arbitrary command execution in the context of the msfvenom process user.
If Mitigated
Limited impact if msfvenom runs in isolated environments with minimal privileges and no network access.
🎯 Exploit Status
Exploitation requires the attacker to craft a malicious APK file and have the victim process it through msfvenom. Public exploit code is available.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Metasploit Framework 6.0.11 and later
Vendor Advisory: https://github.com/rapid7/metasploit-framework/pull/14288
Restart Required: No
Instructions:
1. Update Metasploit Framework to version 6.0.11 or later using 'msfupdate' or package manager. 2. Verify the update completed successfully. 3. No service restart required as msfvenom runs on-demand.
🔧 Temporary Workarounds
Avoid APK template processing
allDo not process untrusted APK files through msfvenom with template functionality.
Run msfvenom in isolated container
linuxExecute msfvenom in Docker or similar container with limited privileges and no network access.
docker run --rm -v $(pwd):/data kalilinux/kali-rolling msfvenom [options]
🧯 If You Can't Patch
- Disable or restrict access to msfvenom for untrusted users.
- Implement strict file validation for APK inputs and monitor for suspicious command execution.
🔍 How to Verify
Check if Vulnerable:
Check Metasploit version with 'msfconsole -v' or 'msfvenom --version'. If version is below 6.0.11, the system is vulnerable when processing APK files.
Check Version:
msfvenom --version
Verify Fix Applied:
After updating, verify version is 6.0.11 or higher using 'msfvenom --version'. Test with known safe APK template to ensure functionality remains.
📡 Detection & Monitoring
Log Indicators:
- Unusual command execution patterns from msfvenom process
- APK file processing with suspicious parameters
- Error logs related to APK template parsing
Network Indicators:
- Outbound connections originating from msfvenom process (unexpected)
SIEM Query:
process_name='msfvenom' AND (command_line LIKE '%apk%' OR command_line CONTAINS suspicious_patterns)
🔗 References
- http://packetstormsecurity.com/files/160004/Rapid7-Metasploit-Framework-msfvenom-APK-Template-Command-Injection.html
- http://packetstormsecurity.com/files/161200/Metasploit-Framework-6.0.11-Command-Injection.html
- https://github.com/rapid7/metasploit-framework/pull/14288
- http://packetstormsecurity.com/files/160004/Rapid7-Metasploit-Framework-msfvenom-APK-Template-Command-Injection.html
- http://packetstormsecurity.com/files/161200/Metasploit-Framework-6.0.11-Command-Injection.html
- https://github.com/rapid7/metasploit-framework/pull/14288