mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
Ruby: Add InsecureDownload query
This query finds cases where a potentially unsafe file is downloaded over an unsecured connection.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import ruby
|
||||
import codeql.ruby.DataFlow
|
||||
import PathGraph
|
||||
import TestUtilities.InlineFlowTest
|
||||
import codeql.ruby.security.InsecureDownloadQuery
|
||||
|
||||
class FlowTest extends InlineFlowTest {
|
||||
override DataFlow::Configuration getValueFlowConfig() { result = any(Configuration config) }
|
||||
|
||||
override DataFlow::Configuration getTaintFlowConfig() { none() }
|
||||
|
||||
override string getARelevantTag() { result = "BAD" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "BAD" and
|
||||
super.hasActualResult(location, element, "hasValueFlow", value)
|
||||
}
|
||||
}
|
||||
|
||||
from DataFlow::PathNode source, DataFlow::PathNode sink, Configuration conf
|
||||
where conf.hasFlowPath(source, sink)
|
||||
select sink, source, sink, "$@", source, source.toString()
|
||||
Reference in New Issue
Block a user