Files
codeql/ruby/ql/test/query-tests/security/cwe-829/InsecureDownload.ql
2023-09-03 17:20:04 +01:00

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()