File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
python/ql/src/experimental/Security/CWE-287-ConstantSecretKey Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 15
15
</p >
16
16
</recommendation >
17
17
<example >
18
+ <p >Safe Django SECRET_KEY</p >
18
19
<sample src =" examples/example_Django_safe.py" />
19
- <sample src =" examples/example_Django_snsafe.py" />
20
+ <p >Unsafe Django SECRET_KEY Example:</p >
21
+ <sample src =" examples/example_Django_unsafe.py" />
22
+ <p >Safe Flask SECRET_KEY Example:</p >
20
23
<sample src =" examples/example_Flask_safe.py" />
21
24
<sample src =" examples/example_Flask_unsafe.py" />
25
+ <p >Unsafe Flask SECRET_KEY Example:</p >
22
26
<sample src =" examples/example_Flask_unsafe2.py" />
27
+ <p >config1.py</p >
23
28
<sample src =" examples/config1.py" />
29
+ <p >config2.py</p >
24
30
<sample src =" examples/config2.py" />
31
+ <p >config3.py</p >
25
32
<sample src =" examples/config3.py" />
33
+ <p >__init__.py</p >
26
34
<sample src =" examples/settings/__init__.py" />
27
35
</example >
28
36
<references >
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ module DjangoConstantSecretKeyConfig {
14
14
predicate isSource ( DataFlow:: Node source ) { source instanceof WebAppConstantSecretKeySource }
15
15
16
16
/**
17
- * A sink like following SECRET_KEY Assignments
17
+ * Holds if There is a sink like following SECRET_KEY Assignments
18
18
* ```python
19
19
*from django.conf import settings
20
20
*settings.configure(
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ module FlaskConstantSecretKeyConfig {
36
36
* app.config.update(SECRET_KEY="CHANGEME3")
37
37
* app.config.from_mapping(SECRET_KEY="CHANGEME4")
38
38
* ```
39
- * other Sinks are SECRET_KEY Constants Variables that are defined in seperate files or a class in those files like:
39
+ * other Sinks are SECRET_KEY Constants Variables that are defined in separate files or a class in those files like:
40
40
* ```python
41
41
* app.config.from_pyfile("config.py")
42
42
* app.config.from_object('config.Config')
@@ -84,7 +84,7 @@ module FlaskConstantSecretKeyConfig {
84
84
}
85
85
86
86
/**
87
- * Assignments like `SECRET_KEY = ConstantValue`
87
+ * An Assignments like `SECRET_KEY = ConstantValue`
88
88
* and `SECRET_KEY` file must be the Location that is specified in argument of `from_object` or `from_pyfile` methods
89
89
*/
90
90
class SecretKeyAssignStmt extends AssignStmt {
@@ -119,7 +119,7 @@ module FlaskConstantSecretKeyConfig {
119
119
}
120
120
121
121
/**
122
- * A helper predicate that specify where the Flask `SECRET_KEY` variable location is defined.
122
+ * Holds if there is a helper predicate that specify where the Flask `SECRET_KEY` variable location is defined.
123
123
* In Flask we have config files that specify the location of `SECRET_KEY` variable initialization
124
124
* and the name of these files are determined by
125
125
* `app.config.from_pyfile("configFileName.py")`
You can’t perform that action at this time.
0 commit comments