mirror of
https://github.com/github/codeql.git
synced 2026-03-22 07:26:45 +01:00
20 lines
716 B
Plaintext
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"
|