10
10
11
11
import javascript
12
12
import CorsPermissiveConfigurationCustomizations:: CorsPermissiveConfiguration
13
+ private import CorsPermissiveConfigurationCustomizations:: CorsPermissiveConfiguration as CorsPermissiveConfiguration
13
14
14
15
/**
15
16
* A data flow configuration for overly permissive CORS configuration.
16
17
*/
17
18
module CorsPermissiveConfigurationConfig implements DataFlow:: StateConfigSig {
18
- class FlowState = DataFlow :: FlowLabel ;
19
+ class FlowState = CorsPermissiveConfiguration :: FlowState ;
19
20
20
- predicate isSource ( DataFlow:: Node source , DataFlow :: FlowLabel label ) {
21
- source instanceof TrueNullValue and label = truenullLabel ( )
21
+ predicate isSource ( DataFlow:: Node source , FlowState state ) {
22
+ source instanceof TrueNullValue and state = FlowState :: trueOrNull ( )
22
23
or
23
- source instanceof WildcardValue and label = wildcardLabel ( )
24
+ source instanceof WildcardValue and state = FlowState :: wildcard ( )
24
25
or
25
- source instanceof RemoteFlowSource and label = DataFlow :: FlowLabel :: taint ( )
26
+ source instanceof RemoteFlowSource and state = FlowState :: taint ( )
26
27
}
27
28
28
- predicate isSink ( DataFlow:: Node sink , DataFlow :: FlowLabel label ) {
29
- sink instanceof CorsApolloServer and label = [ DataFlow :: FlowLabel :: taint ( ) , truenullLabel ( ) ]
29
+ predicate isSink ( DataFlow:: Node sink , FlowState state ) {
30
+ sink instanceof CorsApolloServer and state = [ FlowState :: taint ( ) , FlowState :: trueOrNull ( ) ]
30
31
or
31
- sink instanceof ExpressCors and label = [ DataFlow :: FlowLabel :: taint ( ) , wildcardLabel ( ) ]
32
+ sink instanceof ExpressCors and state = [ FlowState :: taint ( ) , FlowState :: wildcard ( ) ]
32
33
}
33
34
34
35
predicate isBarrier ( DataFlow:: Node node ) { node instanceof Sanitizer }
@@ -44,11 +45,11 @@ deprecated class Configuration extends TaintTracking::Configuration {
44
45
Configuration ( ) { this = "CorsPermissiveConfiguration" }
45
46
46
47
override predicate isSource ( DataFlow:: Node source , DataFlow:: FlowLabel label ) {
47
- CorsPermissiveConfigurationConfig:: isSource ( source , label )
48
+ CorsPermissiveConfigurationConfig:: isSource ( source , FlowState :: fromFlowLabel ( label ) )
48
49
}
49
50
50
51
override predicate isSink ( DataFlow:: Node sink , DataFlow:: FlowLabel label ) {
51
- CorsPermissiveConfigurationConfig:: isSink ( sink , label )
52
+ CorsPermissiveConfigurationConfig:: isSink ( sink , FlowState :: fromFlowLabel ( label ) )
52
53
}
53
54
54
55
override predicate isSanitizer ( DataFlow:: Node node ) {
@@ -57,10 +58,10 @@ deprecated class Configuration extends TaintTracking::Configuration {
57
58
}
58
59
}
59
60
60
- private class WildcardActivated extends DataFlow:: FlowLabel , Wildcard {
61
+ deprecated private class WildcardActivated extends DataFlow:: FlowLabel , Wildcard {
61
62
WildcardActivated ( ) { this = this }
62
63
}
63
64
64
- private class TrueAndNullActivated extends DataFlow:: FlowLabel , TrueAndNull {
65
+ deprecated private class TrueAndNullActivated extends DataFlow:: FlowLabel , TrueAndNull {
65
66
TrueAndNullActivated ( ) { this = this }
66
67
}
0 commit comments