Socket
Socket
Sign inDemoInstall

csv-injection-protector

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    csv-injection-protector

Utility Library to save your CSV file from injection


Version published
Weekly downloads
18
increased by157.14%
Maintainers
1
Install size
5.16 kB
Created
Weekly downloads
 

Readme

Source

csv-injection-protector

Why?

If you have any Input Field and that data goes to the Database in the backend and you generate CSV files with it, then you SHOULD think about CSV injection.

Probably, the string went to your DB is injected. They can execute any operation in the cell and also your CSV file can be corrupted and you can not open that.

It can be sanitized so that string is okay for the CSV.

How to use

Run

npm i csv-injection-protector

Then use in your code like below:

const riskyString = "=Risky string for CSV";
const sanitizedString = csvInjectionProtector(riskyString);
console.log(sanitizedString);
// "Risky string for CSV"

Contribution

git clone https://github.com/destromas1/csv-injection-protector.git

npm i

npm test

npm run build

Feel free to add more cases and PRs are welcome!

Keywords

FAQs

Last updated on 19 Dec 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc