Files
codeql/java/ql/test/query-tests/security/CWE-330/InsecureRandomnessTest.ql
2023-12-11 11:18:40 -05:00

20 lines
595 B
Plaintext

import java
import semmle.code.java.dataflow.DataFlow
import semmle.code.java.security.InsecureRandomnessQuery
import TestUtilities.InlineExpectationsTest
module WeakRandomTest implements TestSig {
string getARelevantTag() { result = "hasWeakRandomFlow" }
predicate hasActualResult(Location location, string element, string tag, string value) {
tag = "hasWeakRandomFlow" and
exists(DataFlow::Node sink | InsecureRandomnessFlow::flowTo(sink) |
sink.getLocation() = location and
element = sink.toString() and
value = ""
)
}
}
import MakeTest<WeakRandomTest>