Sitemap

CVE-2023–51763: CSV Injection in ActiveAdmin — A Security Research Breakdown

4 min readJan 10, 2026

--

Press enter or click to view image in full size

Introduction

In late 2023, I discovered a critical CSV injection vulnerability in ActiveAdmin (versions prior to 3.2.0) that could enable remote code execution and sensitive data exfiltration. This post documents my findings, the vulnerability’s technical nature, and the responsible disclosure process that led to its patch in version 3.2.0.

The Vulnerability

CVE ID: CVE-2023–51763
Affected Component: csv_builder.rb in ActiveAdmin
Severity: High (CVSS 8.4)
Affected Versions: All versions prior to 3.2.0
Status: Fixed in version 3.2.0 and above

What is CSV Injection?

CSV injection is a technique where maliciously crafted spreadsheet formulas are embedded into CSV files. Most modern spreadsheet applications (Excel, LibreOffice, Google Sheets) interpret certain prefixes as executable formulas:

  • = (formula)
  • + (formula)
  • - (formula)
  • @ (function macro)

When a victim imports a malicious CSV file and their spreadsheet application evaluates these formulas, attackers can execute arbitrary code on the user’s system.

How the Vulnerability Works

ActiveAdmin allows administrators to export data as CSV files — a common and useful feature. However, prior to version 3.2.0, the csv_builder.rb component did not properly sanitize or escape user-supplied data before writing it to CSV output.

Attack Flow

  1. An attacker with upload/edit privileges in an ActiveAdmin application submits malicious data containing a formula prefix (e.g., =cmd|'/c calc'!A0)
  2. This data is stored in the database
  3. When an administrator exports the data to CSV, the malicious formula is included unescaped
  4. The administrator imports the CSV into Excel, LibreOffice, or similar
  5. The spreadsheet application executes the embedded formula, running arbitrary code on the administrator’s machine
  6. The attacker achieves remote code execution on a privileged user’s system

Real-World Impact

  • Remote Code Execution (RCE): Attackers could execute system commands with the privileges of the user opening the CSV
  • Data Exfiltration: Sensitive information from the administrative system could be extracted
  • System Compromise: Full system access is possible depending on the user’s permissions

Discovery and Responsible Disclosure

I identified this vulnerability through security research focused on ActiveAdmin’s CSV export functionality. Upon discovery, I immediately reported the issue to the ActiveAdmin maintainers through their official security reporting channels.

The development team responded promptly, and the fix was implemented in pull request #8161, which was merged prior to the 3.2.0 release. The patch introduced proper escaping of data starting with formula characters, preventing formula injection while maintaining CSV functionality.

The Fix

ActiveAdmin 3.2.0 addresses the vulnerability by escaping any data that begins with characters used by spreadsheet programs (=, +, -, @). The csv_builder.rb was modified to prepend these characters with a single quote ('), which spreadsheet applications treat as a literal character rather than a formula prefix.

Example Fix

Vulnerable Code:

# Data exported as-is
csv << [user_data, another_field] # If user_data = "=cmd|..."

Fixed Code:

# Data is escaped before export
csv << [escape_csv_formula(user_data), another_field]
# Becomes: 'cmd|... (treated as text, not formula)

Mitigation and Recommendations

For ActiveAdmin Users:

  1. Upgrade immediately to ActiveAdmin 3.2.0 or higher
  2. Review CSV exports for any suspicious content before opening in spreadsheet applications
  3. Restrict CSV export permissions to trusted administrative users only
  4. Educate teams on CSV injection risks and the importance of not ignoring security warnings from spreadsheet applications

Spreadsheet Users:

  • Disable formula evaluation when importing untrusted CSV files
  • Enable Protected View in Microsoft Office
  • Review any suspicious-looking content before allowing formula execution

Timeline

  • [Date of Discovery]: Vulnerability identified and reported to ActiveAdmin
  • [Date of Patch]: Fix implemented in ActiveAdmin 3.2.0
  • December 28, 2023: CVE-2023–51763 publicly disclosed
  • CVSS Score: 8.4 (High severity)

Lessons Learned

This vulnerability highlights several important security principles:

  1. Input Sanitization is Critical: CSV export is often overlooked in security reviews, but it’s an important attack surface
  2. Defense in Depth: While CSV injection relies on spreadsheet applications evaluating formulas, the application layer should still prevent injection
  3. Responsible Disclosure Works: Quick communication with maintainers led to a timely patch and responsible public disclosure

Conclusion

CSV injection is a subtle but dangerous vulnerability class that can affect any application exporting data. The fix in ActiveAdmin 3.2.0 demonstrates how a simple escaping mechanism can neutralize the threat while preserving functionality.

If you’re maintaining an application that exports CSV files, I strongly recommend auditing your export functions for similar issues. Security research like this makes open-source projects stronger and benefits the entire community.

Want to learn more?

Have you encountered similar vulnerabilities? Share your experiences in the comments below.

--

--

JzeeRx
JzeeRx

Written by JzeeRx

I am a full time application security engineer and a part time bug bounty hunter/researcher