@@ -64,20 +64,20 @@ private class FollowsSanitizingPrefix extends UnsafeUrlForwardSanitizer {
64
64
*/
65
65
private class ExactStringPathMatchGuard extends UnsafeUrlForwardBarrierGuard instanceof MethodAccess {
66
66
ExactStringPathMatchGuard ( ) {
67
- this .getMethod ( ) .getDeclaringType ( ) instanceof TypeString and
68
- this .getMethod ( ) .getName ( ) = [ "equals" , "equalsIgnoreCase" ]
67
+ super .getMethod ( ) .getDeclaringType ( ) instanceof TypeString and
68
+ super .getMethod ( ) .getName ( ) = [ "equals" , "equalsIgnoreCase" ]
69
69
}
70
70
71
71
override predicate checks ( Expr e , boolean branch ) {
72
- e = this . ( MethodAccess ) .getQualifier ( ) and
72
+ e = super .getQualifier ( ) and
73
73
branch = true
74
74
}
75
75
}
76
76
77
77
private class AllowListGuard extends Guard instanceof MethodAccess {
78
78
AllowListGuard ( ) {
79
- ( isStringPartialMatch ( this . ( MethodAccess ) ) or isPathPartialMatch ( this . ( MethodAccess ) ) ) and
80
- not isDisallowedWord ( this . ( MethodAccess ) .getAnArgument ( ) )
79
+ ( isStringPartialMatch ( this ) or isPathPartialMatch ( this ) ) and
80
+ not isDisallowedWord ( super .getAnArgument ( ) )
81
81
}
82
82
83
83
Expr getCheckedExpr ( ) { result = super .getQualifier ( ) }
@@ -124,7 +124,7 @@ private class DotDotCheckBarrierGuard extends UnsafeUrlForwardBarrierGuard insta
124
124
private class BlockListGuard extends Guard instanceof MethodAccess {
125
125
BlockListGuard ( ) {
126
126
( isStringPartialMatch ( this ) or isPathPartialMatch ( this ) ) and
127
- isDisallowedWord ( this .getAnArgument ( ) )
127
+ isDisallowedWord ( super .getAnArgument ( ) )
128
128
}
129
129
130
130
Expr getCheckedExpr ( ) { result = super .getQualifier ( ) }
@@ -193,9 +193,9 @@ private class PathTraversalGuard extends Guard instanceof MethodAccess {
193
193
Expr checked ;
194
194
195
195
PathTraversalGuard ( ) {
196
- this .getMethod ( ) .getDeclaringType ( ) instanceof TypeString and
197
- this .getMethod ( ) .hasName ( [ "contains" , "indexOf" ] ) and
198
- this .getAnArgument ( ) .( CompileTimeConstantExpr ) .getStringValue ( ) = ".."
196
+ super .getMethod ( ) .getDeclaringType ( ) instanceof TypeString and
197
+ super .getMethod ( ) .hasName ( [ "contains" , "indexOf" ] ) and
198
+ super .getAnArgument ( ) .( CompileTimeConstantExpr ) .getStringValue ( ) = ".."
199
199
}
200
200
201
201
Expr getCheckedExpr ( ) { result = super .getQualifier ( ) }
@@ -212,9 +212,9 @@ private class PathNormalizeSanitizer extends MethodAccess {
212
212
/** A complementary guard that protects against double URL encoding, by looking for the literal `%`. */
213
213
private class UrlEncodingGuard extends Guard instanceof MethodAccess {
214
214
UrlEncodingGuard ( ) {
215
- this .getMethod ( ) .getDeclaringType ( ) instanceof TypeString and
216
- this .getMethod ( ) .hasName ( [ "contains" , "indexOf" ] ) and
217
- this .getAnArgument ( ) .( CompileTimeConstantExpr ) .getStringValue ( ) = "%"
215
+ super .getMethod ( ) .getDeclaringType ( ) instanceof TypeString and
216
+ super .getMethod ( ) .hasName ( [ "contains" , "indexOf" ] ) and
217
+ super .getAnArgument ( ) .( CompileTimeConstantExpr ) .getStringValue ( ) = "%"
218
218
}
219
219
220
220
Expr getCheckedExpr ( ) { result = super .getQualifier ( ) }
0 commit comments