Files
codeql/java/ql/test/query-tests/security/CWE-273/UnsafeCertTrustTest.ql

25 lines
795 B
Plaintext

import java
import semmle.code.java.security.UnsafeCertTrustQuery
import TestUtilities.InlineExpectationsTest
class UnsafeCertTrustTest extends InlineExpectationsTest {
UnsafeCertTrustTest() { this = "HasUnsafeCertTrustTest" }
override string getARelevantTag() { result = "hasUnsafeCertTrust" }
override predicate hasActualResult(Location location, string element, string tag, string value) {
tag = "hasUnsafeCertTrust" and
exists(Expr unsafeTrust |
unsafeTrust instanceof RabbitMQEnableHostnameVerificationNotSet
or
exists(SslEndpointIdentificationFlowConfig config |
config.hasFlowTo(DataFlow::exprNode(unsafeTrust))
)
|
unsafeTrust.getLocation() = location and
element = unsafeTrust.toString() and
value = ""
)
}
}