@@ -5,15 +5,9 @@ import java
55/** Holds if `call` disables CSRF protection in Spring. */
66predicate disablesSpringCsrfProtection ( MethodCall call ) {
77 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>" )
1711 or
1812 call .getMethod ( )
1913 .hasQualifiedName ( "org.springframework.security.config.annotation.web.builders" ,
@@ -23,4 +17,18 @@ predicate disablesSpringCsrfProtection(MethodCall call) {
2317 .getReferencedCallable ( )
2418 .hasQualifiedName ( "org.springframework.security.config.annotation.web.configurers" ,
2519 "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" )
2634}
0 commit comments