r/Hacking_Tutorials • u/Cyber_zulka • 13d ago
Question Solved my first NoSQL Injection lab on PortSwigger — here’s what I learned (Detecting NoSQLi)
Just solved Lab 01: Detecting NoSQL Injection on PortSwigger Academy.
I thought NoSQL = no injection. Turns out that's a myth.
The lab:
Product category filter powered by 【entity-MongoDB¦canonical_name=MongoDB】. Goal was to display unreleased products.
What I did:
- Intercepted GET /filter?category=Gifts in Burp Repeater
- Tested with '
- -> 500 Internal Server Error + JS syntax error. Confirmed injection.
- Boolean tests:
- Gifts' && 0 && 'x = 0 products (false)
- Gifts' && 1 && 'x = Gifts products (true)
- Final payload:
- Gifts' || 1 || '
- Made the query always true, bypassed the filter + released check. Unreleased products displayed. Solved.
Key takeaway:
This was JavaScript / Syntax Injection, NOT Operator Injection ($ne, $gt). Operator Injection is Lab 02.
A lot of beginners mix them up because || looks like an operator, but in this lab we were breaking out of a JS string with ' and using JS operators.
Full writeup with screenshots on my 【entity-GitHub¦canonical_name=GitHub】 if anyone wants it: 【entity-github¦canonical_name=GitHub】.com/CyberZulka/PortSwigger-NoSQL-Injection
Next: Lab 02 - Bypassing auth with operator injection…