Skip to content

Commit 4ce25c0

Browse files
committed
Simplify the query
1 parent ab49397 commit 4ce25c0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

java/ql/src/Security/CWE/CWE-352/SpringCSRFProtection.ql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
import java
1414

15-
from MethodAccess call, Method method
15+
from MethodAccess call
1616
where
17-
call.getMethod() = method and
18-
method.hasName("disable") and
19-
method.getDeclaringType().getQualifiedName().regexpMatch(
20-
"org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<CsrfConfigurer<.*>,.*>"
17+
call.getMethod().hasName("disable") and
18+
call.getReceiverType().hasQualifiedName(
19+
"org.springframework.security.config.annotation.web.configurers",
20+
"CsrfConfigurer<HttpSecurity>"
2121
)
2222
select call, "CSRF vulnerability due to protection being disabled."

0 commit comments

Comments
 (0)