NoSQLi
The example below is based on PostSwigger's Exploiting NoSQL operator injection to bypass authentication lab.
A simplified example of how mongodb
queries filters data using mongoplayground can be found below (Figure 1).

Replicating the above authentication bypass attempt does not seem to work (Figure 2).

The error message indicates that we might not have an exact match for the administrator
username. Thus, we can try injecting a regex payload for the username
parameter (Figure 3 & 4).

username
parameter.
To solve the lab, the cookie must be entered manually through the browser.
Last updated
Was this helpful?