← Quiz: SQL Injection: all 10 questions
Quiz: SQL Injection · Question 10 of 10
A MongoDB login accepts JSON and an attacker sends {"password": {"$ne": ""}}. What is the fix?
A MongoDB login accepts JSON and an attacker sends {"password": {"$ne": ""}}. What is the fix?
- A.Use HTTPS
- B.Add a CAPTCHA
- C.Validate types: accept only a string where a string is expected
- D.Rename the password field
Answer & explanation
Correct answer: Validate types: accept only a string where a string is expected
This is NoSQL injection: an operator object instead of a plain value.
Can you get the rest right without peeking?
Take the timed Quiz: SQL Injection quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →