Files
codeql/javascript/ql/src/Security/CWE-338/InsecureRandomness.ql
2018-11-14 09:16:40 +00:00

20 lines
716 B
Plaintext

/**
* @name Insecure randomness
* @description Using a cryptographically weak pseudo-random number generator to generate a
* security-sensitive value may allow an attacker to predict what value will
* be generated.
* @kind path-problem
* @problem.severity warning
* @precision high
* @id js/insecure-randomness
* @tags security
* external/cwe/cwe-338
*/
import javascript
import semmle.javascript.security.dataflow.InsecureRandomness::InsecureRandomness
import DataFlow::PathGraph
from Configuration cfg, DataFlow::Node source, DataFlow::Node sink
where cfg.hasFlow(source, sink)
select sink, "Cryptographically insecure $@ in a security context.", source, "random value"