Injection
NoSQL Injection
NoSQL injection manipulates queries in document and key-value databases like MongoDB, Redis, and CouchDB by injecting operators or special syntax.
- 173 payloads
- 1 file
- README on GitHub
Payloads are read from main at 35c1f2b (committed 22 Nov 2026). Project version 1.0.2.
These payloads are for authorized testing only: systems you own, authorized bug bounty programs, or controlled lab environments. Unauthorized testing is illegal.
Payload files
Use the arrow keys to move between payloads. Press Enter or C to copy the focused payload.
nosql-injection-payloads.txt
173 payloads · 9.1 KBLoading payloads for NoSQL Injection…
What it is#
NoSQL injection is a vulnerability where an attacker can inject or manipulate NoSQL queries to bypass authentication, extract data, or perform unauthorized operations. Unlike SQL injection, NoSQL injection often targets operator injection (MongoDB $ne, $gt, $regex), JSON body manipulation, or Redis command injection rather than string-based query manipulation.
Attack vectors#
- Login forms passing credentials to MongoDB find()/findOne()
- Search parameters parsed as JSON objects
- API endpoints accepting JSON request bodies
- Query string parameters that map to database operators
- Cookie values used in database lookups
Testing methodology#
- Test MongoDB operator injection: replace string values with {$ne: null}
- Submit JSON with $gt, $lt, $regex operators in parameter values
- Test for authentication bypass by injecting {$gt: ''} in password field
- Try array injection in parameters expecting strings
- Test Redis command injection in connection string parameters
Indicators of vulnerability#
- Authentication succeeds with injected operators instead of valid credentials
- Query returns all documents when operators like $ne or $gt are injected
- Application reflects or exposes raw MongoDB query errors
- Unexpected data returned for manipulated query parameters
Detection guidance#
Validate that JSON inputs only contain expected scalar types, not objects. Monitor for MongoDB operator keys ($ne, $gt, $regex, $where) appearing in request parameters. Use schema validation on incoming data.
Mitigation and remediation#
- Validate that query parameters are expected scalar types before use
- Reject inputs containing MongoDB operator keys ($ne, $gt, $where, etc.)
- Use a schema validation library to enforce input structure
- Avoid constructing queries from raw user-supplied JSON objects
- Apply field-level encryption for sensitive data in the database
References#
Responsible Use
All content in this reference is for authorized security testing only. Use only on systems you own or have explicit written permission to test.
- Systems and applications you own
- Authorized penetration testing engagements
- Bug bounty programs with defined scope
- Educational lab environments (DVWA, WebGoat, HackTheBox)