CVE-2023-51763

9.8 CRITICAL

📋 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

Products:
  • ActiveAdmin (Ruby on Rails admin framework)
Versions: All versions before 3.2.0
Operating Systems: All operating systems running Ruby/Rails
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in the CSV export functionality of ActiveAdmin. Any installation with CSV export enabled is vulnerable.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: HIGH - Any ActiveAdmin instance with CSV export functionality exposed to the internet is vulnerable to attack.
🏢 Internal Only: MEDIUM - Internal users could still be targeted through social engineering or compromised accounts.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

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

all

Manually 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

📤 Share & Export