JS: Port BrokenCryptoAlgorithm

This commit is contained in:
Asger F
2023-10-05 09:12:29 +02:00
parent 395f52303c
commit 85617c292e
3 changed files with 28 additions and 27 deletions

View File

@@ -14,11 +14,11 @@
import javascript
import semmle.javascript.security.dataflow.BrokenCryptoAlgorithmQuery
import semmle.javascript.security.SensitiveActions
import DataFlow::PathGraph
import BrokenCryptoAlgorithmFlow::PathGraph
from Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
from BrokenCryptoAlgorithmFlow::PathNode source, BrokenCryptoAlgorithmFlow::PathNode sink
where
cfg.hasFlowPath(source, sink) and
BrokenCryptoAlgorithmFlow::flowPath(source, sink) and
not source.getNode() instanceof CleartextPasswordExpr // flagged by js/insufficient-password-hash
select sink.getNode(), source, sink, "A broken or weak cryptographic algorithm depends on $@.",
source.getNode(), "sensitive data from " + source.getNode().(Source).describe()