Compare commits

...

3 Commits

Author SHA1 Message Date
Jean Helie
5c04d53333 change query id 2022-08-15 11:25:48 +02:00
Jean Helie
e545920460 fix NosqlInjection.ql metadata 2022-08-12 16:10:36 +02:00
Jean Helie
d884532244 add NoSqlInjection.ql 2022-08-12 13:34:59 +02:00

View File

@@ -0,0 +1,28 @@
/**
* NosqlInjection.ql
*
* For internal use only.
*
* Version of the standard NoSQL injection query with an output relation ready to plug into the
* evaluation pipeline.
*
* @name NoSQL database query built from user-controlled sources
* @description Building a database query from user-controlled sources is vulnerable to insertion of
* malicious code by the user.
* @kind path-problem
* @problem.severity error
* @security-severity 8.8
* @id js/ml-powered/nosql-injection-ref
* @tags experimental security
*/
import javascript
import semmle.javascript.security.dataflow.NosqlInjection
import DataFlow::PathGraph
from DataFlow::Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
where
cfg instanceof NosqlInjection::Configuration and
cfg.hasFlowPath(source, sink)
select sink.getNode(), source, sink, "NosqlInjection vulnerability due to $@.", source.getNode(),
"a user-provided value"