mirror of
https://github.com/github/codeql.git
synced 2026-01-28 22:02:57 +01:00
There's so little in this query that it may not be worth sharing, but it's an interesting exercise in figuring out how we do it nicely.
26 lines
834 B
Plaintext
26 lines
834 B
Plaintext
/**
|
|
* Provides a taint tracking configuration for reasoning about writing user-controlled data to files.
|
|
*
|
|
* Note, for performance reasons: only import this file if
|
|
* `HttpToFileAccess::Configuration` is needed, otherwise
|
|
* `HttpToFileAccessCustomizations` should be imported instead.
|
|
*/
|
|
|
|
private import HttpToFileAccessCustomizations::HttpToFileAccess
|
|
|
|
/**
|
|
* A taint tracking configuration for writing user-controlled data to files.
|
|
*/
|
|
class Configuration extends TaintTracking::Configuration {
|
|
Configuration() { this = "HttpToFileAccess" }
|
|
|
|
override predicate isSource(DataFlow::Node source) { source instanceof Source }
|
|
|
|
override predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
|
|
|
|
override predicate isSanitizer(DataFlow::Node node) {
|
|
super.isSanitizer(node) or
|
|
node instanceof Sanitizer
|
|
}
|
|
}
|