CVE-2023-51763
📋 TL;DR
CVE-2023-51763 is a CSV injection vulnerability in ActiveAdmin's csv_builder.rb that allows attackers to inject malicious formulas into exported CSV files. When users open these CSV files in spreadsheet applications like Excel, the formulas can execute arbitrary commands, potentially leading to remote code execution. This affects all ActiveAdmin installations before version 3.2.0.
💻 Affected Systems
- ActiveAdmin (Ruby on Rails admin framework)
📦 What is this software?
Active Admin by Activeadmin
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution on victim's machine when they open a malicious CSV file in Excel or similar spreadsheet software, potentially leading to full system compromise.
Likely Case
Data theft, malware installation, or credential harvesting when users open manipulated CSV files from ActiveAdmin exports.
If Mitigated
Limited impact with proper user education about CSV file safety and spreadsheet security settings.
🎯 Exploit Status
Exploitation requires user interaction (opening CSV file) but the injection itself is straightforward. Proof of concept exists in the GitHub commit and pull request.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.2.0
Vendor Advisory: https://github.com/activeadmin/activeadmin/releases/tag/v3.2.0
Restart Required: Yes
Instructions:
1. Update Gemfile to 'gem "activeadmin", ">= 3.2.0"'. 2. Run 'bundle update activeadmin'. 3. Restart your Rails application server.
🔧 Temporary Workarounds
CSV Sanitization Workaround
allManually sanitize CSV output by prefixing formula cells with a single quote
Override csv_builder.rb methods to add: value = "'" + value.to_s if value.to_s.start_with?('=', '+', '-', '@')
🧯 If You Can't Patch
- Disable CSV export functionality in ActiveAdmin configuration
- Implement web application firewall rules to block CSV injection payloads
🔍 How to Verify
Check if Vulnerable:
Check your Gemfile.lock for activeadmin version: grep -i activeadmin Gemfile.lock
Check Version:
grep -A1 "activeadmin" Gemfile.lock | grep -E "\s+[0-9]+"
Verify Fix Applied:
Verify activeadmin version is 3.2.0 or higher: bundle exec rails runner "puts ActiveAdmin::VERSION"
📡 Detection & Monitoring
Log Indicators:
- CSV export requests containing formula characters (=, +, -, @) in parameter values
Network Indicators:
- CSV file downloads from ActiveAdmin endpoints with suspicious content types
SIEM Query:
source="rails.log" AND ("CSV" OR "export") AND ("=" OR "+" OR "-" OR "@")
🔗 References
- https://github.com/activeadmin/activeadmin/commit/697be2b183491beadc8f0b7d8b5bfb44f2387909
- https://github.com/activeadmin/activeadmin/pull/8161
- https://github.com/activeadmin/activeadmin/releases/tag/v3.2.0
- https://jzee-rx.medium.com/cve-2023-51763-csv-injection-in-activeadmin-a-security-research-breakdown-d5b0d3663aa4
- https://github.com/activeadmin/activeadmin/commit/697be2b183491beadc8f0b7d8b5bfb44f2387909
- https://github.com/activeadmin/activeadmin/pull/8161
- https://github.com/activeadmin/activeadmin/releases/tag/v3.2.0