koles / ya-csv

CSV parser/writer for Node.js
MIT License
242 stars 55 forks source link

Add writer option to escape formulas #44

Closed cstigler closed 8 years ago

cstigler commented 9 years ago

Currently, the CSV writer will output exactly what it is input. If the input starts with a formula trigger (+, =, or -) this will cause the formula to be executed in Excel/OpenOffice/LibreOffice/etc. When the spreadsheet data is generated from user input, this can be dangerous.

See this OWASP page about the security vulnerability. While some users may intentionally include formulas in their CSV files, there should be an option to escape them. This PR adds that option, escapeFormulas.