@@ -6,12 +6,11 @@ import DataFlow
66 */
77class TokenValidationParametersPropertySensitiveValidation extends Property {
88 TokenValidationParametersPropertySensitiveValidation ( ) {
9- exists ( Property p , Class c |
9+ exists ( Class c |
1010 c .hasQualifiedName ( "Microsoft.IdentityModel.Tokens.TokenValidationParameters" )
1111 |
12- p = this and
13- c .getAProperty ( ) = p and
14- p .getName ( ) in [
12+ c .getAProperty ( ) = this and
13+ this .getName ( ) in [
1514 "ValidateIssuer" , "ValidateAudience" , "ValidateLifetime" , "RequireExpirationTime" ,
1615 "RequireAudience"
1716 ]
@@ -34,8 +33,8 @@ class FalseValueFlowsToTokenValidationParametersPropertyWriteToBypassValidation
3433
3534 override predicate isSink ( DataFlow:: Node sink ) {
3635 exists ( Assignment a |
37- sink .asExpr ( ) = a . getRValue ( ) and
38- a . getLValue ( ) . ( PropertyAccess ) . getProperty ( ) instanceof TokenValidationParametersPropertySensitiveValidation
36+ sink .asExpr ( ) =
37+ any ( TokenValidationParametersPropertySensitiveValidation p ) . getAnAssignedValue ( )
3938 )
4039 }
4140}
@@ -106,12 +105,11 @@ private class FlowsToTokenValidationResultIsValidCall extends DataFlow::Configur
106105 */
107106class TokenValidationParametersProperty extends Property {
108107 TokenValidationParametersProperty ( ) {
109- exists ( Property p , Class c |
108+ exists ( Class c |
110109 c .hasQualifiedName ( "Microsoft.IdentityModel.Tokens.TokenValidationParameters" )
111110 |
112- p = this and
113- c .getAProperty ( ) = p and
114- p .getName ( ) in [
111+ c .getAProperty ( ) = this and
112+ this .getName ( ) in [
115113 "SignatureValidator" , "TokenReplayValidator" , "AlgorithmValidator" , "AudienceValidator" ,
116114 "IssuerSigningKeyValidator" , "LifetimeValidator"
117115 ]
@@ -153,9 +151,7 @@ class CallableAlwaysReturnsTrue extends Callable {
153151 or
154152 lambdaExprReturnsOnlyLiteralTrue ( this )
155153 or
156- exists ( AnonymousFunctionExpr le , Call call , Callable callable |
157- this = le
158- |
154+ exists ( AnonymousFunctionExpr le , Call call , Callable callable | this = le |
159155 callable .getACall ( ) = call and
160156 call = le .getExpressionBody ( ) and
161157 callableHasAReturnStmtAndAlwaysReturnsTrue ( callable )
@@ -231,13 +227,13 @@ class CallableAlwaysReturnsParameter0 extends CallableReturnsStringAndArg0IsStri
231227class CallableAlwaysReturnsParameter0MayThrowExceptions extends CallableReturnsStringAndArg0IsString {
232228 CallableAlwaysReturnsParameter0MayThrowExceptions ( ) {
233229 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+ )
239236 )
240- )
241237 }
242238}
243239
0 commit comments