Skip to content
RCE Write-up Intermediate

Unveiling the Sneaky CSV Injection: VDP vs. Objective-Based Offensive Tactics

A CSV export feature failed to sanitise user input, allowing formula injection. An attacker could craft a link that, when opened in Excel, executes formulas to run local programs or exfiltrate data.

abawazeeer Follow

Published on abawazeeer.medium.com

Welcome to the world of cybersecurity hide-and-seek, where we’re on a mission to find and fix sneaky computer bugs. But not all bugs are treated the same — some are easy to find, while others are like hidden treasures waiting to be discovered.

AliBawazeEer, on abawazeeer.medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application did not sanitise or escape user-supplied values before writing them to a CSV file, allowing formula characters to be interpreted by spreadsheet software.

Impact

Arbitrary formulas can be injected into CSV files, which could lead to remote code execution on the internal user's side or data leakage via malicious hyperlinks.

What the attacker needed

Victim opens the CSV in Excel; attacker can inject input into CSV export; victim clicks a crafted link

The fix

The application should sanitise user input by prefixing cells that begin with =, +, -, or @ with an apostrophe, or by validating input to allow only trusted characters.

How it was found

  1. Send a request with two values and capture it in a proxy tool.
  2. Monitor the downloaded CSV file.
  3. Inject a formula payload into the request.
  4. Observe that the request is filtered due to special characters.
  5. Encode the payload using URL encoding and CHAR encoding to bypass the filter.
  6. The final payload is delivered and the CSV file contains the injected formula.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

CSV files are simple spreadsheets. If a program puts user input into a CSV without cleaning it, and someone opens that file in Excel, Excel may treat the input as a formula and run it. This can let an attacker run programs or steal data on the victim's computer.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.