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

Encode Formulas to prevent CSV injection #103

Closed
maennchen opened this issue Oct 6, 2021 · 1 comment
Closed

Encode Formulas to prevent CSV injection #103

maennchen opened this issue Oct 6, 2021 · 1 comment

Comments

@maennchen
Copy link
Contributor

maennchen commented Oct 6, 2021

If this is a feature request, why do we need it?

  • We are using this library to generate CSVs for user-generated input and transmitting them to another party. (Which sadly requires a CSV and not a sane format like a JSON)
  • We did a pentest on the application
  • The pentest uncovered a CSV Injection vulnerability, if the user-generated input includes formulas like =1+1

To address this, I suggest to implement encoding of =1+1 as "'=1+1"

If this is a bug, steps to reproduce it

  • Generate a CSV with a cell value of =1+1
  • Open with Excel
  • See value 2
  • Is your input CSV RFC 4180 compliant? - Yes
  • Are you interested in helping with a PR? - Yes
@beatrichartz
Copy link
Owner

PR is merged, thanks

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

2 participants