DEV Community

Discussion on: Beware of the findOne function

Collapse
 
pbnj profile image
Peter Benjamin (they/them)

Good write up.
Some additional resources for those interested in reading more:

Collapse
 
nulldreams profile image
Igor Souza Martins

Niceee

Collapse
 
phlash profile image
Phil Ashby

Good advice from the MongoDB team in their documentation, using the same approach as that to defeat injection in SQL, and more generally across other injection attacks - avoid server-side interpreters:

docs.mongodb.com/manual/faq/fundam...

..for MongoDB either through direct use of BSON queries and separate user-data (equivalent of prepared queries in SQL clients), or by disabling server-side Javascript entirely - consider this first IMO!