Skip to content

Commit 7f9dff2

Browse files
committed
Fix minor error in Weak Hashing
1 parent e43fafc commit 7f9dff2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

java/ql/lib/semmle/code/java/security/MaybeBrokenCryptoAlgorithmQuery.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ module InsecureCryptoConfig implements DataFlow::ConfigSig {
4444
predicate isSource(DataFlow::Node n) {
4545
n.asExpr() instanceof InsecureAlgoLiteral
4646
or
47-
exists(PropertiesGetPropertyMethodCall mc | n.asExpr() = mc |
47+
exists(PropertiesGetPropertyMethodCall mc, string value |
48+
n.asExpr() = mc and value = mc.getPropertyValue()
49+
|
4850
// Since properties pairs are not included in the java/weak-crypto-algorithm,
4951
// The check for values from properties files can be less strict than `InsecureAlgoLiteral`.
50-
not mc.getPropertyValue().regexpMatch(getSecureAlgorithmRegex())
52+
not value.regexpMatch(getSecureAlgorithmRegex())
5153
)
5254
}
5355

0 commit comments

Comments
 (0)