CSV Injection with the CVS export feature - Glossary
The CSV export did not escape fields, allowing spreadsheet formulas to be injected via glossary terms; opening the CSV could evaluate them.
- Fixed in under an hour
- Disclosed after 20 days
Hi,
The "Download as a CSV" feature of Weblate does not properly "escape" fields. Here is more information about this issue: http://www.contextis.com/resources/blog/comma-separated-vulnerabilities/
Here is one method to reproduce this issue:
- I can add new information in Glossary with a name starting with "=1+1;" or "-2+3+cmd|' /C calc'!G2;"
- I choose to export all Glossary to CSV containing the issue in (1)
- I now open this CSV file in excel or another spreadsheet program
- You can see the cell containing the issue name in (1) is displayed as "2" (=1+1;) which means the code is executed.
Attachments
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 application failed to sanitise or escape user-controlled fields when generating CSV output, allowing formula injection.
Impact
An attacker could cause spreadsheet formulas to be evaluated when a victim opens the exported CSV.
What the attacker needed
Ability to add glossary entries; victim opens exported CSV in spreadsheet
How it was found
- Add a new glossary entry with a name that starts with a spreadsheet formula.
- Export all glossary entries to CSV.
- Open the exported CSV file in a spreadsheet program.
- Observe that the cell displays the result of the formula, indicating 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 report has not been written yet. The Original tab links to the source.
When you export data to a CSV file, spreadsheet programs like Excel treat certain characters at the start of a cell as formulas. If an attacker can put such a formula into a field that gets exported, opening the file can run that formula on your computer. This is called CSV injection.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.