1010
1111import javascript
1212import CorsPermissiveConfigurationCustomizations:: CorsPermissiveConfiguration
13+ private import CorsPermissiveConfigurationCustomizations:: CorsPermissiveConfiguration as CorsPermissiveConfiguration
1314
1415/**
1516 * A data flow configuration for overly permissive CORS configuration.
1617 */
1718module CorsPermissiveConfigurationConfig implements DataFlow:: StateConfigSig {
18- class FlowState = DataFlow :: FlowLabel ;
19+ class FlowState = CorsPermissiveConfiguration :: FlowState ;
1920
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 ( )
2223 or
23- source instanceof WildcardValue and label = wildcardLabel ( )
24+ source instanceof WildcardValue and state = FlowState :: wildcard ( )
2425 or
25- source instanceof RemoteFlowSource and label = DataFlow :: FlowLabel :: taint ( )
26+ source instanceof RemoteFlowSource and state = FlowState :: taint ( )
2627 }
2728
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 ( ) ]
3031 or
31- sink instanceof ExpressCors and label = [ DataFlow :: FlowLabel :: taint ( ) , wildcardLabel ( ) ]
32+ sink instanceof ExpressCors and state = [ FlowState :: taint ( ) , FlowState :: wildcard ( ) ]
3233 }
3334
3435 predicate isBarrier ( DataFlow:: Node node ) { node instanceof Sanitizer }
@@ -44,11 +45,11 @@ deprecated class Configuration extends TaintTracking::Configuration {
4445 Configuration ( ) { this = "CorsPermissiveConfiguration" }
4546
4647 override predicate isSource ( DataFlow:: Node source , DataFlow:: FlowLabel label ) {
47- CorsPermissiveConfigurationConfig:: isSource ( source , label )
48+ CorsPermissiveConfigurationConfig:: isSource ( source , FlowState :: fromFlowLabel ( label ) )
4849 }
4950
5051 override predicate isSink ( DataFlow:: Node sink , DataFlow:: FlowLabel label ) {
51- CorsPermissiveConfigurationConfig:: isSink ( sink , label )
52+ CorsPermissiveConfigurationConfig:: isSink ( sink , FlowState :: fromFlowLabel ( label ) )
5253 }
5354
5455 override predicate isSanitizer ( DataFlow:: Node node ) {
@@ -57,10 +58,10 @@ deprecated class Configuration extends TaintTracking::Configuration {
5758 }
5859}
5960
60- private class WildcardActivated extends DataFlow:: FlowLabel , Wildcard {
61+ deprecated private class WildcardActivated extends DataFlow:: FlowLabel , Wildcard {
6162 WildcardActivated ( ) { this = this }
6263}
6364
64- private class TrueAndNullActivated extends DataFlow:: FlowLabel , TrueAndNull {
65+ deprecated private class TrueAndNullActivated extends DataFlow:: FlowLabel , TrueAndNull {
6566 TrueAndNullActivated ( ) { this = this }
6667}
0 commit comments