代码示例1
import javascriptfrom DataFlow::MethodCallNode readFile, DataFlow::Node sourcewherereadFile.getMethodName() = "readFile" andsource.getASuccessor*() = readFile.getArgument(0)select source
捕获示例1
捕获示例2
import javascriptfrom DataFlow::CallNode method, DataFlow::Node sourcewheremethod = DataFlow::globalVarRef("document").getAMethodCall("write")and source.getASuccessor*() = method.getArgument(0)select source
捕获示例
Taint tracking
import javascriptclass WriteLocationConfiguration extends TaintTracking::Configuration {WriteLocationConfiguration() { this = "WriteLocationConfiguration" }override predicate isSource(DataFlow::Node source) {DataFlow::globalVarRef("document").getAPropertyRead("location").getAPropertyRead() = source}override predicate isSink(DataFlow::Node sink) {DataFlow::globalVarRef("document").getAMethodCall("write").getArgument(0) = sink}}from WriteLocationConfiguration cfg, DataFlow::Node source, DataFlow::Node sinkwhere cfg.hasFlow(source, sink)select source, sink
捕获示例
