Skip to content

Commit fad7e94

Browse files
committed
Add a query to detect instances of CSRF protection being disabled
1 parent 8a412dc commit fad7e94

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @name CSRF protection disabled
3+
* @description Disabling CSRF protection makes the application vulnerable to
4+
* a Cross-Site Request Forgery (CSRF) attack.
5+
* @kind problem
6+
* @problem.severity warning
7+
* @security-severity 8.8
8+
* @precision high
9+
* @id rb/csrf-protection-disabled
10+
* @tags security
11+
* external/cwe/cwe-352
12+
*/
13+
14+
import ruby
15+
import codeql.ruby.Concepts
16+
17+
from CSRFProtectionSetting s
18+
where s.getVerificationSetting() = false
19+
select s, "Potential CSRF vulnerability due to forgery protection being disabled."

0 commit comments

Comments
 (0)