High severityJavaScript / TypeScriptInjectionHIGH confidence
NoSQL Query From Request
A raw request object is passed directly as a MongoDB query, allowing operator injection (e.g. {"$gt":""}).
Standards mapping
- OWASP Top 10
- A03:2021 - Injection
- OWASP ASVS
- V5.3.6 (L1)
Vulnerable vs. safe
Flagged by this check
User.find(req.body);Passes - the safe pattern
User.find({ name: req.body.name });Why it matters & how to fix it
A raw request object is passed directly as a MongoDB query, allowing operator injection (e.g. {"$gt":""}). Extract and cast individual scalar fields instead of forwarding req.body/req.query.
References
Rule ID integsec-js-nosql-query-from-request - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - InjectionCode Injection Tainted Input
- JavaScript / TypeScript - InjectionEval Dynamic Argument
- JavaScript / TypeScript - InjectionNoSQL Where Operator
- JavaScript / TypeScript - InjectionOS Command Injection Tainted Input
- JavaScript / TypeScript - InjectionSQL Injection String Concatenation
- JavaScript / TypeScript - InjectionSQL Injection Tainted Input