mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +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
|
from CSRFProtectionSetting s
|
||||||
where
|
where
|
||||||
s.getVerificationSetting() = false and
|
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."
|
select s, "Potential CSRF vulnerability due to forgery protection being disabled or weakened."
|
||||||
|
|||||||
Reference in New Issue
Block a user