Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL injections with noSQL databases?

I am using mongoDB currently, and I am wondering what measures we should take to ensure that any data that could cause problems isn't stored. I believe that normal PHP functions like mysql_escape_string isn't going to help here...

Is there SQL injections for noSQL databases and especially mongoDB?
If so, what can we do to protect us from them?

like image 410
Industrial Avatar asked Sep 07 '10 10:09

Industrial


People also ask

Is NoSQL injection possible?

SQL injection is a code injection technique that might destroy your database. SQL injection is one of the most common web hacking techniques. SQL injection is the placement of malicious code in SQL statements, via web page input.

Is a NoSQL database still vulnerable to SQL injection attack?

By requiring fewer relational constraints and consistency checks, NoSQL databases often offer performance and scaling benefits. Yet these databases are still potentially vulnerable to injection attacks, even if they aren't using the traditional SQL syntax.

Is SQL injection possible in MongoDB?

As we acknowledged earlier, MongoDB is vulnerable to SQL injection attacks. Even though it's a NoSQL database. In combination with Node. js, MongoDB is a powerful tool.


1 Answers

See MongoDB's documentation:

Generally, with MongoDB we are not building queries from strings, so traditional SQL Injection attacks are not a problem.

There are other issues to be aware of, so it's worth giving that page a read.

like image 60
Dominic Rodger Avatar answered Sep 23 '22 03:09

Dominic Rodger