mirror of
https://github.com/github/codeql.git
synced 2025-12-23 04:06:37 +01:00
python: rule out test code for CSRF
This commit is contained in:
@@ -17,5 +17,7 @@ import semmle.python.Concepts
|
||||
from CSRFProtectionSetting s
|
||||
where
|
||||
s.getVerificationSetting() = false and
|
||||
not exists(CSRFProtection p)
|
||||
not exists(CSRFProtection p) and
|
||||
// rule out test code as this is a common place to turn off CSRF protection
|
||||
not s.getLocation().getFile().getAbsolutePath().matches("%test%")
|
||||
select s, "Potential CSRF vulnerability due to forgery protection being disabled or weakened."
|
||||
|
||||
Reference in New Issue
Block a user