mirror of
https://github.com/github/codeql.git
synced 2026-03-02 13:53:42 +01:00
An auto-generated patch that enables diff-informed data flow in the obvious cases. Builds on github#18346 and github/codeql-patch#88
26 lines
966 B
Plaintext
26 lines
966 B
Plaintext
/** Provides taint tracking configurations to be used in Unsafe Resource Fetching queries. */
|
|
|
|
import java
|
|
import semmle.code.java.dataflow.FlowSources
|
|
import semmle.code.java.dataflow.TaintTracking
|
|
import semmle.code.java.security.RequestForgery
|
|
import semmle.code.java.security.UnsafeAndroidAccess
|
|
|
|
/**
|
|
* A taint configuration tracking flow from untrusted inputs to a resource fetching call.
|
|
*/
|
|
module FetchUntrustedResourceConfig implements DataFlow::ConfigSig {
|
|
predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource }
|
|
|
|
predicate isSink(DataFlow::Node sink) { sink instanceof UrlResourceSink }
|
|
|
|
predicate isBarrier(DataFlow::Node sanitizer) { sanitizer instanceof RequestForgerySanitizer }
|
|
|
|
predicate observeDiffInformedIncrementalMode() { any() }
|
|
}
|
|
|
|
/**
|
|
* Detects taint flow from untrusted inputs to a resource fetching call.
|
|
*/
|
|
module FetchUntrustedResourceFlow = TaintTracking::Global<FetchUntrustedResourceConfig>;
|