mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
/**
|
|
* Provides a taint-tracking configuration for detecting regular expression injection
|
|
* vulnerabilities.
|
|
*
|
|
* Note, for performance reasons: only import this file if
|
|
* `RegexInjection::Configuration` is needed, otherwise
|
|
* `RegexInjectionCustomizations` should be imported instead.
|
|
*/
|
|
|
|
private import python
|
|
import semmle.python.dataflow.new.DataFlow
|
|
import semmle.python.dataflow.new.TaintTracking
|
|
|
|
/**
|
|
* Provides a taint-tracking configuration for detecting regular expression injection
|
|
* vulnerabilities.
|
|
*/
|
|
module RegexInjection {
|
|
import RegexInjectionCustomizations::RegexInjection
|
|
|
|
/**
|
|
* A taint-tracking configuration for detecting "reflected server-side cross-site scripting" vulnerabilities.
|
|
*/
|
|
class Configuration extends TaintTracking::Configuration {
|
|
Configuration() { this = "RegexInjection" }
|
|
|
|
override predicate isSource(DataFlow::Node source) { source instanceof Source }
|
|
|
|
override predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
|
|
|
|
override predicate isSanitizer(DataFlow::Node node) { node instanceof Sanitizer }
|
|
|
|
override predicate isSanitizerGuard(DataFlow::BarrierGuard guard) {
|
|
guard instanceof SanitizerGuard
|
|
}
|
|
}
|
|
}
|