We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d39410a commit 3416f07Copy full SHA for 3416f07
python/ql/src/Security/CWE-352/CSRFProtectionDisabled.ql
@@ -18,6 +18,8 @@ from HTTP::Server::CsrfProtectionSetting s
18
where
19
s.getVerificationSetting() = false and
20
not exists(HTTP::Server::CsrfLocalProtectionSetting p | p.csrfEnabled()) and
21
- // rule out test code as this is a common place to turn off CSRF protection
+ // rule out test code as this is a common place to turn off CSRF protection.
22
+ // We don't use normal `TestScope` to find test files, since we also want to match
23
+ // a settings file such as `.../integration-tests/settings.py`
24
not s.getLocation().getFile().getAbsolutePath().matches("%test%")
25
select s, "Potential CSRF vulnerability due to forgery protection being disabled or weakened."
0 commit comments