Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV Injection [Medium (6.8) to High (8.0)] #20

Closed
ghost opened this issue Jul 15, 2019 · 1 comment
Closed

CSV Injection [Medium (6.8) to High (8.0)] #20

ghost opened this issue Jul 15, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 15, 2019

Description

CSV Injection, also known as Formula Injection, occurs when websites embed untrusted input inside CSV files.

Details

The web application embeds untrusted user input inside the "Account ID" and "Account Name" field, there is likely more fields that are vulnerable to this, however this is just an example. In this case a simple formula was used but an attacker can use a malicious formula that might download a file from the internet and have it executed to gain access.

The following shows the CSV injection point:
CSV-Injection-Point

Download the CSV:
CSV-Injection

Open the CSV file and observe the output:
CSV-Injection-Output

Impact

When a spreadsheet program such as Microsoft Excel or LibreOffice Calc is used to open a CSV, any cells starting with '=' will be interpreted by the software as a formula. Maliciously crafted formulas can be used for three key attacks:

  • Hijacking the user's computer by exploiting vulnerabilities in the spreadsheet software, such as CVE-2014-3524
  • Hijacking the user's computer by exploiting the user's tendency to ignore security warnings in spreadsheets that they downloaded from their own website
  • Exfiltrating contents from the spreadsheet, or other open spreadsheets.

Recommendation

This attack is difficult to mitigate, and explicitly disallowed from quite a few bug bounty programs. To remediate it, ensure that no cells begin with any of the following characters:

  • Equals to ("=")
  • Plus ("+")
  • Minus ("-")
  • At ("@")

References

https://www.owasp.org/index.php/CSV_Injection

@jogetworkflow
Copy link
Collaborator

jogetworkflow commented Jul 16, 2019

Thanks for reporting this. After research and evaluation, the conclusion is that this is not a platform security issue.

CSV is a plain text format (the format is defined in RFC 4180) that has no active content, and may be imported and used by various other systems, not just spreadsheets. It is the client spreadsheet software (e.g. Excel, OpenOffice) that interprets the text values. For example, Excel will warn about executing commands. This is similar to the interpretation of the Google security team. If the export is meant specifically for spreadsheets, then the Excel format should be chosen instead of CSV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants