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 0f2c21c commit 53de828Copy full SHA for 53de828
python/ql/src/Security/CWE-352/CSRFProtectionDisabled.ql
@@ -17,5 +17,7 @@ import semmle.python.Concepts
17
from CSRFProtectionSetting s
18
where
19
s.getVerificationSetting() = false and
20
- not exists(CSRFProtection p)
+ not exists(CSRFProtection p) and
21
+ // rule out test code as this is a common place to turn off CSRF protection
22
+ not s.getLocation().getFile().getAbsolutePath().matches("%test%")
23
select s, "Potential CSRF vulnerability due to forgery protection being disabled or weakened."
0 commit comments