Files
codeql/javascript/ql/src/Security/CWE-834/LoopBoundInjection.ql
2021-08-12 09:30:18 +02:00

23 lines
717 B
Plaintext

/**
* @name Loop bound injection
* @description Iterating over an object with a user-controlled .length
* property can cause indefinite looping.
* @kind path-problem
* @problem.severity warning
* @security-severity 6.5
* @id js/loop-bound-injection
* @tags security
* external/cwe/cwe-834
* @precision high
*/
import javascript
import semmle.javascript.security.dataflow.LoopBoundInjectionQuery
import DataFlow::PathGraph
from Configuration dataflow, DataFlow::PathNode source, DataFlow::PathNode sink
where dataflow.hasFlowPath(source, sink)
select sink, source, sink,
"Iterating over user-controlled object with a potentially unbounded .length property from $@.",
source, "here"