Protection against CSV injection attacks
See original GitHub issueWhen importing a CSV file, Microsoft Excel and LibreOffice Calc will both interpret cells beginning with a =
as formulae, which can lead to attacks that can result in data exfiltration or arbitrary command execution. [1] This is easily remedied by prefixing cells that begin with =
, +
, -
or @
with a '
in order to suppress automatic interpretation of formulae by these softwares. [2]
I would like to propose an option escapeFormulae
for Papa.unparse
to provide this prefixing behaviour.
Thanks!
[1] https://owasp.org/www-community/attacks/CSV_Injection [2] https://www.contextis.com/en/blog/comma-separated-vulnerabilities
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:15 (3 by maintainers)
Top Results From Across the Web
CSV Injection - OWASP Foundation
CSV Injection, also known as Formula Injection, occurs when websites embed untrusted input inside CSV files. When a spreadsheet program such as Microsoft ......
Read more >CSV injection attacks explained - Comparitech
In this article we look at CSV injection attacks including examples of CSV injections, how they work and how to defend against them....
Read more >How To Prevent CSV Injection - Affinity IT Security
CSV Injection, also known as Formula Injection, can be prevented by escaping the spreadsheet meta-characters that signal the start of a ...
Read more >CSV Injection – A Guide to Protecting Your CSV Files - Payatu
CSV Injection aka Formula Injection. It occurs when websites embed untrusted user input inside CSV files without validating. When the user tries ...
Read more >Your Excel Sheets Are Not Safe! Here's How to Beat CSV ...
CSV Injection occurs when the data in a spreadsheet cell is not properly validated prior to export. The attacker usually injects a malicious ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi there! 👋
My name is Asaf and I’m part of the Snyk Security Team. We have been tracking this issue for a few days now, and an advisory has been mistakenly published. I tend to agree with all the above arguments and do not believe there is a vuln within the context of
papaparse
.I have therefore revoked this advisory from our database. I apologize for any inconvenience caused by this.
For further inquiries please don’t hesitate to contact us at report@snyk.io or using the vulnerability disclosure form.
I think interpretation of the data is out of scope for a CSV parser and lends itself to more security problems, not less.