Quantcast
Channel: JavaScript NoSQL Injection prevention in MongoDB - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by Sushant Gupta for JavaScript NoSQL Injection prevention in MongoDB

$
0
0

NoteMy answer is incorrect. Please refer to other answers.

--

As a client program assembles a query in MongoDB, it builds a BSON object, not a string. Thus traditional SQL injection attacks are not a problem.

For details follow the documentation

UPDATE

Avoid expression like eval which can execute arbitrary JS. If you are taking input from user and running eval like expressions without cleaning the input you can screw up. As pointed by JoBu1324, operations like where, mapReduce and group permit to execute JS expressions directly.


Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>