CVE-2018-20752
📋 TL;DR
This CSV injection vulnerability in Recon-ng allows attackers to embed malicious Excel macros in Twitter usernames that execute when the CSV export is opened in Excel. Users of Recon-ng who export data to CSV files and open them in spreadsheet software are affected. The vulnerability enables remote code execution on the victim's machine.
💻 Affected Systems
- Recon-ng
📦 What is this software?
Recon Ng by Recon Ng Project
⚠️ Risk & Real-World Impact
Worst Case
Full remote code execution on the victim's system when malicious CSV file is opened in Excel with macros enabled, potentially leading to complete system compromise.
Likely Case
Limited code execution in Excel environment when macros are enabled, potentially stealing data or installing malware.
If Mitigated
No impact if CSV files are opened in text editors or spreadsheet software with macros disabled.
🎯 Exploit Status
Exploitation requires the attacker to control Twitter username data that gets exported to CSV, and the victim to open the CSV in Excel with macros enabled.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 4.9.5 and later
Vendor Advisory: https://bitbucket.org/LaNMaSteR53/recon-ng/commits/41e96fd58891439974fb0c920b349f8926c71d4c
Restart Required: No
Instructions:
1. Update Recon-ng to version 4.9.5 or later using: git pull origin master
2. Verify the update with: recon-ng --version
3. No restart required as it's a Python tool.
🔧 Temporary Workarounds
Disable Excel macros
windowsConfigure Excel to disable macros by default when opening CSV files
Use text editors for CSV
allOpen CSV files in text editors instead of spreadsheet software
🧯 If You Can't Patch
- Avoid exporting Twitter data to CSV format
- Manually sanitize CSV exports by prefixing suspicious cells with apostrophe (')
🔍 How to Verify
Check if Vulnerable:
Check Recon-ng version with: recon-ng --version. If version is below 4.9.5, you are vulnerable.
Check Version:
recon-ng --version
Verify Fix Applied:
Verify version is 4.9.5 or higher and check that modules/reporting/csv.py contains proper input sanitization.
📡 Detection & Monitoring
Log Indicators:
- Unusual Excel macro execution from CSV files
- Excel security warnings about macros
Network Indicators:
- CSV file downloads from Recon-ng instances
SIEM Query:
source="excel" AND event="macro_execution" AND file_extension="csv"
🔗 References
- https://bitbucket.org/LaNMaSteR53/recon-ng/commits/41e96fd58891439974fb0c920b349f8926c71d4c#chg-modules/reporting/csv.py
- https://bitbucket.org/LaNMaSteR53/recon-ng/issues/285/csv-injection-vulnerability-identified-in
- https://bitbucket.org/LaNMaSteR53/recon-ng/commits/41e96fd58891439974fb0c920b349f8926c71d4c#chg-modules/reporting/csv.py
- https://bitbucket.org/LaNMaSteR53/recon-ng/issues/285/csv-injection-vulnerability-identified-in