$4,800 for an Equals Sign: CSV Formula Injection That Turns an Ex
Free-text survey responses were written directly into CSV exports without neutralising leading formula characters, so a respondent could embed a spreadsheet formula. When an administrator opened the export in a permissively configured spreadsheet application, the formula could execute an external command on the administrator's machine.
This is the bug I’ve had the hardest time convincing people outside security actually matters. “You typed a formula into a text field, and a spreadsheet program did spreadsheet things with it” sounds, on first hearing, like a non-issue — almost a feature working as intended. It took building the full chain, from a…
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
The export feature wrote user-supplied text into CSV cells without escaping leading characters that spreadsheet applications interpret as formula triggers.
Impact
Any respondent, including unauthenticated anonymous users, could embed a formula that may execute a command on an administrator's machine when the exported CSV is opened in a vulnerable or permissively configured spreadsheet application.
What the attacker needed
Ability to submit a survey response; administrator exports responses as CSV; administrator opens export in vulnerable spreadsheet
The fix
The platform added export-time sanitisation, prefixing formula-triggering leading characters across every export format.
How it was found
- Submit a survey response beginning with an equals sign.
- Export the responses as a CSV file.
- Open the CSV in a spreadsheet application and observe the cell evaluated as a formula.
- Submit a response containing a formula that invokes an external command.
- Export and open the file in an isolated virtual machine to confirm command execution.
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.
A CSV file is a plain list of values separated by commas. Spreadsheet programs like Excel add extra meaning: if a cell starts with =, +, - or @, they treat it as a formula and calculate it. Here, a survey answer starting with = was saved into the export unchanged, so opening the file made the spreadsheet run the answer as a formula, which in some configurations can start a program on the computer.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.