@@ -5,15 +5,9 @@ import java
5
5
/** Holds if `call` disables CSRF protection in Spring. */
6
6
predicate disablesSpringCsrfProtection ( MethodCall call ) {
7
7
call .getMethod ( ) .hasName ( "disable" ) and
8
- (
9
- call .getReceiverType ( )
10
- .hasQualifiedName ( "org.springframework.security.config.annotation.web.configurers" ,
11
- "CsrfConfigurer<HttpSecurity>" )
12
- or
13
- call .getReceiverType ( )
14
- .hasQualifiedName ( "org.springframework.security.config.web.server" ,
15
- "ServerHttpSecurity$CsrfSpec" )
16
- )
8
+ call .getReceiverType ( )
9
+ .hasQualifiedName ( "org.springframework.security.config.annotation.web.configurers" ,
10
+ "CsrfConfigurer<HttpSecurity>" )
17
11
or
18
12
call .getMethod ( )
19
13
.hasQualifiedName ( "org.springframework.security.config.annotation.web.builders" ,
@@ -23,4 +17,18 @@ predicate disablesSpringCsrfProtection(MethodCall call) {
23
17
.getReferencedCallable ( )
24
18
.hasQualifiedName ( "org.springframework.security.config.annotation.web.configurers" ,
25
19
"AbstractHttpConfigurer" , "disable" )
20
+ or
21
+ call .getMethod ( ) .hasName ( "disable" ) and
22
+ call .getReceiverType ( )
23
+ .hasQualifiedName ( "org.springframework.security.config.web.server" ,
24
+ "ServerHttpSecurity$CsrfSpec" )
25
+ or
26
+ call .getMethod ( )
27
+ .hasQualifiedName ( "org.springframework.security.config.web.server" , "ServerHttpSecurity" ,
28
+ "csrf" ) and
29
+ call .getArgument ( 0 )
30
+ .( MemberRefExpr )
31
+ .getReferencedCallable ( )
32
+ .hasQualifiedName ( "org.springframework.security.config.web.server" ,
33
+ "ServerHttpSecurity$CsrfSpec" , "disable" )
26
34
}
0 commit comments