mirror of
https://github.com/github/codeql.git
synced 2026-04-20 22:44:52 +02:00
Merge pull request #18161 from owen-mc/java/weak-crypto-algo-more-informative
Java: Make `java/weak-cryptographic-algorithm` give a reason why the algo is insecure
This commit is contained in:
@@ -18,10 +18,11 @@ import InsecureCryptoFlow::PathGraph
|
||||
|
||||
from
|
||||
InsecureCryptoFlow::PathNode source, InsecureCryptoFlow::PathNode sink, CryptoAlgoSpec spec,
|
||||
BrokenAlgoLiteral algo
|
||||
BrokenAlgoLiteral algo, string reason
|
||||
where
|
||||
sink.getNode().asExpr() = spec.getAlgoSpec() and
|
||||
source.getNode().asExpr() = algo and
|
||||
reason = getInsecureAlgorithmReason(algo.getValue()) and
|
||||
InsecureCryptoFlow::flowPath(source, sink)
|
||||
select spec, source, sink, "Cryptographic algorithm $@ is weak and should not be used.", algo,
|
||||
select spec, source, sink, "Cryptographic algorithm $@ is insecure. " + reason, algo,
|
||||
algo.getValue()
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: fix
|
||||
---
|
||||
* The query "Use of a broken or risky cryptographic algorithm" (`java/weak-cryptographic-algorithm`) now gives the reason why the cryptographic algorithm is considered weak.
|
||||
Reference in New Issue
Block a user