CSV Injection on Public Bug Bounty Program
A job-posting platform allowed an organisation name to be exported into a CSV file without neutralising spreadsheet formulas. An attacker could inject a formula that, when the file was opened, would create a clickable link to an external site.
medium.com
Published on medium.com
I was scrolling on bugcrowd looking for a target to get a possible payout. Well, I saw an attractive logo and went straight to the scope and ran subfinder (without looking at submitted reports..).
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 failed to escape or prefix user-supplied values that begin with formula characters before writing them into the CSV export.
Impact
If a victim opened the exported CSV in a spreadsheet program, the injected formula could create a clickable link to an attacker-controlled site; the text does not show code execution because command-based payloads were filtered.
What the attacker needed
A free account; ability to create an organisation; victim opens the exported CSV
How it was found
- Create an organisation and set its name to a formula-like value.
- Export the organisation data to CSV.
- Open the exported CSV and observe that the formula is evaluated.
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 plain text tables that spreadsheet programs like Excel open. If a cell starts with a formula character such as '=', the spreadsheet may treat it as a formula and run it. Here the site put user-controlled text into a CSV export without escaping it, so a malicious formula could end up in the file.