Reputation: 95
I´m building up a proyect with NodeJS, JavaScript and MongoDB and wanna prevent scripting execution. I´ve searched for a long time and I found the node module ("sanitize") but is all time working wrong with errors like "Error Invalid type" (when I use STRING for sanitize).
Also don´t know how prevent MongoDB scripting and is a thing that is worrying me a lot.
I keep reading Mongo, Node and JavaScript forums and post here on StackOverflow about this, but I think this post can be interesting for future developers that like me, are starting on security stuff of programing.
Any help would be well recived! <3
Upvotes: 0
Views: 168
Reputation: 468
May you should try this:
const mongoSanitize = require('express-mongo-sanitize');
// Data sanitization against NoSQL query injection
app.use(mongoSanitize());
Upvotes: 1