@@ -12,29 +12,29 @@ private import semmle.javascript.security.dataflow.DomBasedXssCustomizations
12
12
private import semmle.javascript.security.dataflow.NosqlInjectionCustomizations
13
13
private import semmle.javascript.security.dataflow.TaintedPathCustomizations
14
14
15
- abstract class ClassificationReason extends string {
16
- // The name of the reason , which should describe some characteristic of the endpoint that is meaningful for
15
+ abstract class EndpointCharacteristic extends string {
16
+ // The name of the characteristic , which should describe some characteristic of the endpoint that is meaningful for
17
17
// determining whether it's a sink and if so of which type
18
18
bindingset [ this ]
19
- ClassificationReason ( ) { any ( ) }
19
+ EndpointCharacteristic ( ) { any ( ) }
20
20
21
21
// Indicators with confidence at or above this threshold are considered to be high-confidence indicators.
22
22
float getHighConfidenceThreshold ( ) { result = 0.8 }
23
23
24
24
// Indicators with confidence at or above this threshold are considered to be medium-confidence indicators.
25
25
float getMediumConfidenceThreshold ( ) { result = 0.5 }
26
26
27
- // The logic to identify which endpoints have this reason .
27
+ // The logic to identify which endpoints have this characteristic .
28
28
abstract predicate getEndpoints ( DataFlow:: Node n ) ;
29
29
30
- // This predicate describes what the reason tells us about an endpoint.
30
+ // This predicate describes what the characteristic tells us about an endpoint.
31
31
//
32
32
// Params:
33
33
// endpointClass: Class 0 is the negative class. Each positive int corresponds to a single sink type.
34
- // isPositiveIndicator: Does this reason indicate this endpoint _is_ a member of the class, or that it _isn't_ a
35
- // member of the class?
36
- // confidence: A number in [0, 1], which tells us how strong an indicator this reason is for the endpoint belonging /
37
- // not belonging to the given class.
34
+ // isPositiveIndicator: Does this characteristic indicate this endpoint _is_ a member of the class, or that it
35
+ // _isn't_ a member of the class?
36
+ // confidence: A number in [0, 1], which tells us how strong an indicator this characteristic is for the endpoint
37
+ // belonging / not belonging to the given class.
38
38
abstract predicate getImplications (
39
39
EndpointType endpointClass , boolean isPositiveIndicator , float confidence
40
40
) ;
@@ -45,8 +45,8 @@ abstract class ClassificationReason extends string {
45
45
* confidence.
46
46
*/
47
47
48
- class DomBasedXssSinkReason extends ClassificationReason {
49
- DomBasedXssSinkReason ( ) { this = "DomBasedXssSink" }
48
+ class DomBasedXssSinkCharacteristic extends EndpointCharacteristic {
49
+ DomBasedXssSinkCharacteristic ( ) { this = "DomBasedXssSink" }
50
50
51
51
override predicate getEndpoints ( DataFlow:: Node n ) { n instanceof DomBasedXss:: Sink }
52
52
@@ -62,8 +62,8 @@ class DomBasedXssSinkReason extends ClassificationReason {
62
62
* maximal confidence.
63
63
*/
64
64
65
- class TaintedPathSinkReason extends ClassificationReason {
66
- TaintedPathSinkReason ( ) { this = "TaintedPathSink" }
65
+ class TaintedPathSinkCharacteristic extends EndpointCharacteristic {
66
+ TaintedPathSinkCharacteristic ( ) { this = "TaintedPathSink" }
67
67
68
68
override predicate getEndpoints ( DataFlow:: Node n ) { n instanceof TaintedPath:: Sink }
69
69
@@ -79,8 +79,8 @@ class TaintedPathSinkReason extends ClassificationReason {
79
79
* maximal confidence.
80
80
*/
81
81
82
- class SqlInjectionSinkReason extends ClassificationReason {
83
- SqlInjectionSinkReason ( ) { this = "SqlInjectionSink" }
82
+ class SqlInjectionSinkCharacteristic extends EndpointCharacteristic {
83
+ SqlInjectionSinkCharacteristic ( ) { this = "SqlInjectionSink" }
84
84
85
85
override predicate getEndpoints ( DataFlow:: Node n ) { n instanceof SqlInjection:: Sink }
86
86
@@ -98,8 +98,8 @@ class SqlInjectionSinkReason extends ClassificationReason {
98
98
* with maximal confidence.
99
99
*/
100
100
101
- class NosqlInjectionSinkReason extends ClassificationReason {
102
- NosqlInjectionSinkReason ( ) { this = "NosqlInjectionSink" }
101
+ class NosqlInjectionSinkCharacteristic extends EndpointCharacteristic {
102
+ NosqlInjectionSinkCharacteristic ( ) { this = "NosqlInjectionSink" }
103
103
104
104
override predicate getEndpoints ( DataFlow:: Node n ) { n instanceof NosqlInjection:: Sink }
105
105
0 commit comments