Skip to content

Commit a710b72

Browse files
committed
Move the definition of isSink to the base class:
Holds if `sink` is a known taint sink or an "effective" sink.
1 parent cd24ec8 commit a710b72

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/ATMConfig.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ abstract class AtmConfig extends JS::TaintTracking::Configuration {
3939
*/
4040
override predicate isSource(JS::DataFlow::Node source) { this.isKnownSource(source) }
4141

42+
/**
43+
* Holds if `sink` is a known taint sink or an "effective" sink (a candidate to be classified by an ML model).
44+
*/
45+
override predicate isSink(JS::DataFlow::Node sink) {
46+
this.isKnownSink(sink) or this.isEffectiveSink(sink)
47+
}
48+
4249
/**
4350
* EXPERIMENTAL. This API may change in the future.
4451
*

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/SqlInjectionATM.qll

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ class Configuration extends AtmConfig {
2121
* query, except additional sinks have been added using the sink endpoint filter.
2222
*/
2323

24-
override predicate isSink(DataFlow::Node sink) {
25-
sink instanceof SqlInjection::Sink or isEffectiveSink(sink)
26-
}
27-
2824
override predicate isSanitizer(DataFlow::Node node) {
2925
super.isSanitizer(node) or
3026
node instanceof SqlInjection::Sanitizer

javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/XssATM.qll

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ class Configuration extends AtmConfig {
2121
* except additional ATM sinks have been added to the `isSink` predicate.
2222
*/
2323

24-
override predicate isSink(DataFlow::Node sink) {
25-
sink instanceof DomBasedXss::Sink or
26-
isEffectiveSink(sink)
27-
}
28-
2924
override predicate isSanitizer(DataFlow::Node node) {
3025
super.isSanitizer(node) or
3126
node instanceof DomBasedXss::Sanitizer

0 commit comments

Comments
 (0)