mirror of
https://github.com/github/codeql.git
synced 2026-06-18 19:31:11 +02:00
detects a hard-coded cipher key for shiro
This commit is contained in:
@@ -27,9 +27,9 @@ class HardcodedCredentialApiCallConfiguration extends DataFlow::Configuration {
|
||||
|
||||
override predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
|
||||
node1.asExpr().getType() instanceof TypeString and
|
||||
exists(MethodAccess ma | ma.getMethod().hasName(["getBytes", "toCharArray"]) |
|
||||
exists(MethodAccess ma | ma.getMethod().hasName(["getBytes", "toCharArray","decode"]) |
|
||||
node2.asExpr() = ma and
|
||||
ma.getQualifier() = node1.asExpr()
|
||||
(ma.getQualifier() = node1.asExpr() or ma.getAnArgument() = node1.asExpr())
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -490,7 +490,8 @@ private predicate javaApiCallableCryptoKeyParam(string s) {
|
||||
s = "sun.security.provider.JavaKeyStore;engineSetKeyEntry(String, byte[], Certificate[]);1" or
|
||||
s = "sun.security.tools.keytool.Main;recoverKey(String, char[], char[]);2" or
|
||||
s = "sun.security.tools.keytool.Main;getKeyPasswd(String, String, char[]);2" or
|
||||
s = "sun.security.x509.X509Key;decode(byte[]);0"
|
||||
s = "sun.security.x509.X509Key;decode(byte[]);0" or
|
||||
s = "org.apache.shiro.mgt.AbstractRememberMeManager;setCipherKey(byte[]);0"
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user