mirror of
https://github.com/github/codeql.git
synced 2026-03-21 23:16:53 +01:00
21 lines
769 B
Plaintext
21 lines
769 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::PathNode source, DataFlow::PathNode sink
|
|
where cfg.hasPathFlow(source, sink)
|
|
select sink.getNode(), source, sink, "Cryptographically insecure $@ in a security context.",
|
|
source.getNode(), "random value"
|