Skip to content

Commit 5596944

Browse files
committed
Add check for disabled CSRF protection in Spring
Fix help and correct formatting.
1 parent c5a9747 commit 5596944

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ result in exposure of data or unintended code execution.</p>
1010
</overview>
1111

1212
<recommendation>
13-
<p>Cross-Site Request Forgery (CSRF) protection is enabled by default. Spring's recommendation
13+
<p>When you use Spring, Cross-Site Request Forgery (CSRF) protection is enabled by default. Spring's recommendation
1414
is to use CSRF protection for any request that could be processed by a browser client by normal
1515
users.</p>
1616
</recommendation>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import java
1515
from MethodAccess call
1616
where
1717
call.getMethod().hasName("disable") and
18-
call.getReceiverType().hasQualifiedName(
19-
"org.springframework.security.config.annotation.web.configurers",
20-
"CsrfConfigurer<HttpSecurity>"
21-
)
18+
call
19+
.getReceiverType()
20+
.hasQualifiedName("org.springframework.security.config.annotation.web.configurers",
21+
"CsrfConfigurer<HttpSecurity>")
2222
select call, "CSRF vulnerability due to protection being disabled."

0 commit comments

Comments
 (0)