Move the definition of isSink to the base class:

Holds if `sink` is a known taint sink or an "effective" sink.
This commit is contained in:
tiferet
2022-11-17 17:57:57 -08:00
parent cd24ec88d6
commit a710b723d1
3 changed files with 7 additions and 9 deletions

View File

@@ -39,6 +39,13 @@ abstract class AtmConfig extends JS::TaintTracking::Configuration {
*/
override predicate isSource(JS::DataFlow::Node source) { this.isKnownSource(source) }
/**
* Holds if `sink` is a known taint sink or an "effective" sink (a candidate to be classified by an ML model).
*/
override predicate isSink(JS::DataFlow::Node sink) {
this.isKnownSink(sink) or this.isEffectiveSink(sink)
}
/**
* EXPERIMENTAL. This API may change in the future.
*

View File

@@ -21,10 +21,6 @@ class Configuration extends AtmConfig {
* query, except additional sinks have been added using the sink endpoint filter.
*/
override predicate isSink(DataFlow::Node sink) {
sink instanceof SqlInjection::Sink or isEffectiveSink(sink)
}
override predicate isSanitizer(DataFlow::Node node) {
super.isSanitizer(node) or
node instanceof SqlInjection::Sanitizer

View File

@@ -21,11 +21,6 @@ class Configuration extends AtmConfig {
* except additional ATM sinks have been added to the `isSink` predicate.
*/
override predicate isSink(DataFlow::Node sink) {
sink instanceof DomBasedXss::Sink or
isEffectiveSink(sink)
}
override predicate isSanitizer(DataFlow::Node node) {
super.isSanitizer(node) or
node instanceof DomBasedXss::Sanitizer