Learning the basics of MongoDB, I read that MongoDB is vulnerable to injection attacks out-of-the-box. In node, this can be prevented using the help of the module mongo-sanitize. So far, so good. Now let's add Mongoose to the equation.
If we are using Mongoose
- Do we still need to sanitize MongoDB inputs? Should we still use mongo-sanitize along with Mongoose?
- Does Mongoose offer any explicit injection protection at all, or does the protection come from enforcing types in schemas and models?
I remember reading that Mongoose can prevent injections to some extent, but I don't know the specifics, or if it is redundant to sanitize against Mongoose.