File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ module FileSystemWriteAccess {
106
106
}
107
107
108
108
/**
109
- * A data-flow node that may set or unset Cross-site request forgery protection
109
+ * A data-flow node that enables or disables Cross-site request forgery protection
110
110
* in a global manner.
111
111
*
112
112
* Extend this class to refine existing API models. If you want to model new APIs,
Original file line number Diff line number Diff line change @@ -2330,8 +2330,12 @@ module PrivateDjango {
2330
2330
mw .asVar ( ) .getName ( ) = "MIDDLEWARE" and
2331
2331
DataFlow:: localFlow ( this , mw )
2332
2332
|
2333
- // it only counts as setting the CSRF protection, if the app uses authentication,
2334
- // so check that the list contains the django authentication middleware.
2333
+ // To only include results where CSRF protection matters, we only care about CSRF
2334
+ // protection when the django authentication middleware is enabled.
2335
+ // Since an active session cookie is exactly what would allow an attacker to perform
2336
+ // a CSRF attack.
2337
+ // Notice that this does not ensure that this is not a FP, since the authentication
2338
+ // middleware might be unused.
2335
2339
//
2336
2340
// This also strongly implies that we are actually looking at the `MIDDLEWARE` setting.
2337
2341
list .getAnElt ( ) .( StrConst ) .getText ( ) =
Original file line number Diff line number Diff line change 6
6
<overview >
7
7
<p >
8
8
Cross-site request forgery (CSRF) is a type of vulnerability in which an
9
- attacker is able to force a user carry out an action that the user did
9
+ attacker is able to force a user to carry out an action that the user did
10
10
not intend.
11
11
</p >
12
12
You can’t perform that action at this time.
0 commit comments