question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Protection against CSV injection attacks

See original GitHub issue

When 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
asafbitoncommented, May 15, 2020

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.

2reactions
mholtcommented, Jan 14, 2022

I think interpretation of the data is out of scope for a CSV parser and lends itself to more security problems, not less.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found