Skip to content

Commit

Permalink
Update nosql_find_injection to support ES6 syntax (ajinabraham#65)
Browse files Browse the repository at this point in the history
* Update nosql_find_injection to support ES6 syntax

There is a lot of backend software running in ES6 syntax. And this syntax is "import X from "Y" replacing the old const X = require("Y")

Co-authored-by: Ajin Abraham <[email protected]>
  • Loading branch information
CharlyJazz and ajinabraham authored Jun 16, 2021
1 parent c6ea106 commit 8dac712
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ rules:
...
$SANITIZE(...)
...
- pattern-not-inside: |
import $SANITIZE from 'mongo-sanitize'
...
$SANITIZE(...)
...
- pattern-either:
- pattern: |
$OBJ.findOne({$KEY : <... $REQ.$FOO.$BAR ...> }, ...)
Expand Down Expand Up @@ -65,4 +70,4 @@ rules:
severity: ERROR
metadata:
owasp: 'A1: Injection'
cwe: 'CWE-943: Improper Neutralization of Special Elements in Data Query Logic'
cwe: 'CWE-943: Improper Neutralization of Special Elements in Data Query Logic'

0 comments on commit 8dac712

Please sign in to comment.