Files
codeql/java/ql/test/query-tests/security/CWE-927/SensitiveResultReceiver.ql
2023-10-24 10:30:26 +01:00

26 lines
796 B
Plaintext

import java
import TestUtilities.InlineExpectationsTest
import semmle.code.java.security.SensitiveResultReceiverQuery
class TestSource extends RemoteFlowSource {
TestSource() { this.asExpr().(MethodCall).getMethod().hasName("source") }
override string getSourceType() { result = "test" }
}
module ResultReceiverTest implements TestSig {
string getARelevantTag() { result = "hasSensitiveResultReceiver" }
predicate hasActualResult(Location loc, string element, string tag, string value) {
exists(SensitiveResultReceiverFlow::PathNode sink |
isSensitiveResultReceiver(_, sink, _) and
element = sink.toString() and
loc = sink.getNode().getLocation() and
tag = "hasSensitiveResultReceiver" and
value = ""
)
}
}
import MakeTest<ResultReceiverTest>