Blind MongoDB Injection
Invicti detected that the application is vulnerable to a Time Based MongoDB injection. MongoDB injections occur when applications don't check or sanitize user input, which is then interpreted by a MongoDB database.
Invicti confirmed the vulnerability by executing test queries on the backend database. In these tests, MongoDB injection was not obvious, but the different responses from the page based on our tests allowed us to identify and confirm the MongoDB injection.
- Reading, updating and deleting arbitrary data or tables from the database
- Collect sensitive information about the backend server configuration
- See the remedy for solution.
- If you are not using a database access layer (DAL), consider using one. This will help you centralize the issue. You can also use ORM (object relational mapping). Most of the ORM systems use only parameterized queries and this can solve the whole SQL injection problem.
- Locate the all dynamically generated SQL queries and convert them to parameterized queries. (If you decide to use a DAL/ORM, change all legacy code to use these new libraries.)
- Use your weblogs and application logs to see if there were any previous but undetected attacks to this resource.
- Sanitize and strictly check the type of user-supplied input.
- Avoid using where, mapReduce and group operators with user input.
- Use the most recent version of MongoDB.