mirror of
https://github.com/github/codeql.git
synced 2025-12-22 11:46:32 +01:00
Refactor InsecureWebResourceResponse
This commit is contained in:
@@ -16,19 +16,20 @@ import semmle.code.java.dataflow.FlowSources
|
|||||||
import semmle.code.java.dataflow.TaintTracking
|
import semmle.code.java.dataflow.TaintTracking
|
||||||
import semmle.code.java.security.PathSanitizer
|
import semmle.code.java.security.PathSanitizer
|
||||||
import AndroidWebResourceResponse
|
import AndroidWebResourceResponse
|
||||||
import DataFlow::PathGraph
|
import InsecureWebResourceResponseFlow::PathGraph
|
||||||
|
|
||||||
class InsecureWebResourceResponseConfig extends TaintTracking::Configuration {
|
module InsecureWebResourceResponseConfig implements DataFlow::ConfigSig {
|
||||||
InsecureWebResourceResponseConfig() { this = "InsecureWebResourceResponseConfig" }
|
predicate isSource(DataFlow::Node src) { src instanceof RemoteFlowSource }
|
||||||
|
|
||||||
override predicate isSource(DataFlow::Node src) { src instanceof RemoteFlowSource }
|
predicate isSink(DataFlow::Node sink) { sink instanceof WebResourceResponseSink }
|
||||||
|
|
||||||
override predicate isSink(DataFlow::Node sink) { sink instanceof WebResourceResponseSink }
|
predicate isBarrier(DataFlow::Node node) { node instanceof PathInjectionSanitizer }
|
||||||
|
|
||||||
override predicate isSanitizer(DataFlow::Node node) { node instanceof PathInjectionSanitizer }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
from DataFlow::PathNode source, DataFlow::PathNode sink, InsecureWebResourceResponseConfig conf
|
module InsecureWebResourceResponseFlow = TaintTracking::Global<InsecureWebResourceResponseConfig>;
|
||||||
where conf.hasFlowPath(source, sink)
|
|
||||||
|
from
|
||||||
|
InsecureWebResourceResponseFlow::PathNode source, InsecureWebResourceResponseFlow::PathNode sink
|
||||||
|
where InsecureWebResourceResponseFlow::flowPath(source, sink)
|
||||||
select sink.getNode(), source, sink, "Leaking arbitrary content in Android from $@.",
|
select sink.getNode(), source, sink, "Leaking arbitrary content in Android from $@.",
|
||||||
source.getNode(), "this user input"
|
source.getNode(), "this user input"
|
||||||
|
|||||||
Reference in New Issue
Block a user