mirror of
https://github.com/github/codeql.git
synced 2026-01-07 11:40:27 +01:00
24 lines
862 B
Plaintext
24 lines
862 B
Plaintext
import codeql.ruby.security.InsecureDownloadQuery
|
|
import InsecureDownloadFlow::PathGraph
|
|
import TestUtilities.InlineExpectationsTest
|
|
import TestUtilities.InlineFlowTestUtil
|
|
|
|
module FlowTest implements TestSig {
|
|
string getARelevantTag() { result = "BAD" }
|
|
|
|
predicate hasActualResult(Location location, string element, string tag, string value) {
|
|
tag = "BAD" and
|
|
exists(DataFlow::Node src, DataFlow::Node sink | InsecureDownloadFlow::flow(src, sink) |
|
|
sink.getLocation() = location and
|
|
element = sink.toString() and
|
|
if exists(getSourceArgString(src)) then value = getSourceArgString(src) else value = ""
|
|
)
|
|
}
|
|
}
|
|
|
|
import MakeTest<FlowTest>
|
|
|
|
from InsecureDownloadFlow::PathNode source, InsecureDownloadFlow::PathNode sink
|
|
where InsecureDownloadFlow::flowPath(source, sink)
|
|
select sink, source, sink, "$@", source, source.toString()
|