@@ -69,8 +69,8 @@ private class ExactPathMatchSanitizer extends PathInjectionSanitizer {
69
69
}
70
70
}
71
71
72
- private class AllowListGuard extends Guard instanceof MethodAccess {
73
- AllowListGuard ( ) {
72
+ private class AllowedPrefixGuard extends Guard instanceof MethodAccess {
73
+ AllowedPrefixGuard ( ) {
74
74
( isStringPrefixMatch ( this ) or isPathPrefixMatch ( this ) ) and
75
75
not isDisallowedWord ( super .getAnArgument ( ) )
76
76
}
@@ -79,27 +79,27 @@ private class AllowListGuard extends Guard instanceof MethodAccess {
79
79
}
80
80
81
81
/**
82
- * Holds if `g` is a guard that considers a path safe because it is checked against an allowlist of partial trusted values .
82
+ * Holds if `g` is a guard that considers a path safe because it is checked against trusted prefixes .
83
83
* This requires additional protection against path traversal, either another guard (`PathTraversalGuard`)
84
84
* or a sanitizer (`PathNormalizeSanitizer`), to ensure any internal `..` components are removed from the path.
85
85
*/
86
- private predicate allowListGuard ( Guard g , Expr e , boolean branch ) {
86
+ private predicate allowedPrefixGuard ( Guard g , Expr e , boolean branch ) {
87
87
branch = true and
88
- TaintTracking:: localExprTaint ( e , g .( AllowListGuard ) .getCheckedExpr ( ) ) and
88
+ TaintTracking:: localExprTaint ( e , g .( AllowedPrefixGuard ) .getCheckedExpr ( ) ) and
89
89
exists ( Expr previousGuard |
90
90
TaintTracking:: localExprTaint ( previousGuard .( PathNormalizeSanitizer ) ,
91
- g .( AllowListGuard ) .getCheckedExpr ( ) )
91
+ g .( AllowedPrefixGuard ) .getCheckedExpr ( ) )
92
92
or
93
93
previousGuard
94
94
.( PathTraversalGuard )
95
95
.controls ( g .getBasicBlock ( ) .( ConditionBlock ) , previousGuard .( PathTraversalGuard ) .getBranch ( ) )
96
96
)
97
97
}
98
98
99
- private class AllowListSanitizer extends PathInjectionSanitizer {
100
- AllowListSanitizer ( ) {
101
- this = DataFlow:: BarrierGuard< allowListGuard / 3 > :: getABarrierNode ( ) or
102
- this = ValidationMethod< allowListGuard / 3 > :: getAValidatedNode ( )
99
+ private class AllowedPrefixSanitizer extends PathInjectionSanitizer {
100
+ AllowedPrefixSanitizer ( ) {
101
+ this = DataFlow:: BarrierGuard< allowedPrefixGuard / 3 > :: getABarrierNode ( ) or
102
+ this = ValidationMethod< allowedPrefixGuard / 3 > :: getAValidatedNode ( )
103
103
}
104
104
}
105
105
@@ -111,7 +111,7 @@ private predicate dotDotCheckGuard(Guard g, Expr e, boolean branch) {
111
111
branch = g .( PathTraversalGuard ) .getBranch ( ) and
112
112
TaintTracking:: localExprTaint ( e , g .( PathTraversalGuard ) .getCheckedExpr ( ) ) and
113
113
exists ( Guard previousGuard |
114
- previousGuard .( AllowListGuard ) .controls ( g .getBasicBlock ( ) .( ConditionBlock ) , true )
114
+ previousGuard .( AllowedPrefixGuard ) .controls ( g .getBasicBlock ( ) .( ConditionBlock ) , true )
115
115
or
116
116
previousGuard .( BlockListGuard ) .controls ( g .getBasicBlock ( ) .( ConditionBlock ) , false )
117
117
)
0 commit comments