vetkit.js.nosql-injection.where-operator
A MongoDB $where clause is built from a dynamic string. $where executes JavaScript on the database server, so any spliced-in value is server-side code injection.
Last updated:
Suite: Security
javascript, typescript
A MongoDB $where clause is built from a dynamic string. $where executes JavaScript on the database server, so any spliced-in value is server-side code injection.
Category: SECURITY · Engine rule severity: ERROR
How to fix it
Replace $where with regular query operators ($eq, $expr, aggregation) and pass values as typed data instead of JavaScript source.
References
Source: packages/engine/rules/sast/javascript.yml.
Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.