@@ -6,12 +6,11 @@ import DataFlow
6
6
*/
7
7
class TokenValidationParametersPropertySensitiveValidation extends Property {
8
8
TokenValidationParametersPropertySensitiveValidation ( ) {
9
- exists ( Property p , Class c |
9
+ exists ( Class c |
10
10
c .hasQualifiedName ( "Microsoft.IdentityModel.Tokens.TokenValidationParameters" )
11
11
|
12
- p = this and
13
- c .getAProperty ( ) = p and
14
- p .getName ( ) in [
12
+ c .getAProperty ( ) = this and
13
+ this .getName ( ) in [
15
14
"ValidateIssuer" , "ValidateAudience" , "ValidateLifetime" , "RequireExpirationTime" ,
16
15
"RequireAudience"
17
16
]
@@ -34,8 +33,8 @@ class FalseValueFlowsToTokenValidationParametersPropertyWriteToBypassValidation
34
33
35
34
override predicate isSink ( DataFlow:: Node sink ) {
36
35
exists ( Assignment a |
37
- sink .asExpr ( ) = a . getRValue ( ) and
38
- a . getLValue ( ) . ( PropertyAccess ) . getProperty ( ) instanceof TokenValidationParametersPropertySensitiveValidation
36
+ sink .asExpr ( ) =
37
+ any ( TokenValidationParametersPropertySensitiveValidation p ) . getAnAssignedValue ( )
39
38
)
40
39
}
41
40
}
@@ -106,12 +105,11 @@ private class FlowsToTokenValidationResultIsValidCall extends DataFlow::Configur
106
105
*/
107
106
class TokenValidationParametersProperty extends Property {
108
107
TokenValidationParametersProperty ( ) {
109
- exists ( Property p , Class c |
108
+ exists ( Class c |
110
109
c .hasQualifiedName ( "Microsoft.IdentityModel.Tokens.TokenValidationParameters" )
111
110
|
112
- p = this and
113
- c .getAProperty ( ) = p and
114
- p .getName ( ) in [
111
+ c .getAProperty ( ) = this and
112
+ this .getName ( ) in [
115
113
"SignatureValidator" , "TokenReplayValidator" , "AlgorithmValidator" , "AudienceValidator" ,
116
114
"IssuerSigningKeyValidator" , "LifetimeValidator"
117
115
]
@@ -153,9 +151,7 @@ class CallableAlwaysReturnsTrue extends Callable {
153
151
or
154
152
lambdaExprReturnsOnlyLiteralTrue ( this )
155
153
or
156
- exists ( AnonymousFunctionExpr le , Call call , Callable callable |
157
- this = le
158
- |
154
+ exists ( AnonymousFunctionExpr le , Call call , Callable callable | this = le |
159
155
callable .getACall ( ) = call and
160
156
call = le .getExpressionBody ( ) and
161
157
callableHasAReturnStmtAndAlwaysReturnsTrue ( callable )
@@ -231,13 +227,13 @@ class CallableAlwaysReturnsParameter0 extends CallableReturnsStringAndArg0IsStri
231
227
class CallableAlwaysReturnsParameter0MayThrowExceptions extends CallableReturnsStringAndArg0IsString {
232
228
CallableAlwaysReturnsParameter0MayThrowExceptions ( ) {
233
229
forex ( Expr ret | this .canReturn ( ret ) |
234
- ret = this .getParameter ( 0 ) .getAnAccess ( )
235
- or
236
- exists ( CallableAlwaysReturnsParameter0MayThrowExceptions c |
237
- ret = c .getACall ( ) and
238
- ret .( Call ) .getArgument ( 0 ) = this .getParameter ( 0 ) .getAnAccess ( )
230
+ ret = this .getParameter ( 0 ) .getAnAccess ( )
231
+ or
232
+ exists ( CallableAlwaysReturnsParameter0MayThrowExceptions c |
233
+ ret = c .getACall ( ) and
234
+ ret .( Call ) .getArgument ( 0 ) = this .getParameter ( 0 ) .getAnAccess ( )
235
+ )
239
236
)
240
- )
241
237
}
242
238
}
243
239
0 commit comments