Lab: Exploiting NoSQL operator injection to bypass authentication
Summary: PortSwigger's lab demonstrates a login backed by a MongoDB NoSQL database that accepts MongoDB operators in its username and password parameters, allowing authentication to be bypassed. Setting the password parameter to {"$ne":""} and the username parameter to {"$regex":"admin.*"} logs the tester in as the administrator user.
What you should know: A single operator in a login field was enough to become admin, so any application passing raw user input into a MongoDB query is one request away from the same outcome.
Read the original at PortSwigger Research ↗
- Topics
- Vulnerabilities & Patching
- Related
- Attackers Exploit UnrealIRCd Flaw That Enables Server-Level Command Injection Cyber Risks · Nov 14, 2026U.S. CISA adds Check Point and UnrealIRCd flaws to its Known Exploited Vulnerabilities catalog Cyber Risks · Nov 14, 2026PostgreSQL Patches 52 Flaws, Including 22-Year-Old Bug Enabling Authenticated RCE Cyber Risks · Nov 13, 2026