File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed
javascript/ql/lib/semmle/javascript/frameworks/helmet Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import javascript
6
6
7
+ /**
8
+ * A write to a property of a route handler from the "helmet" module.
9
+ */
7
10
class HelmetProperty extends DataFlow:: Node instanceof DataFlow:: PropWrite {
8
11
ExpressLibraries:: HelmetRouteHandler helmet ;
9
12
10
13
HelmetProperty ( ) {
11
14
this = helmet .( DataFlow:: CallNode ) .getAnArgument ( ) .getALocalSource ( ) .getAPropertyWrite ( )
12
15
}
13
16
17
+ /**
18
+ * Gets the route handler associated to this property.
19
+ */
14
20
ExpressLibraries:: HelmetRouteHandler getHelmet ( ) { result = helmet }
15
21
22
+ /**
23
+ * Gets the boolean value of this property, if it may evaluate to a `Boolean`.
24
+ */
16
25
predicate isFalse ( ) { DataFlow:: PropWrite .super .getRhs ( ) .mayHaveBooleanValue ( false ) }
17
26
27
+ /**
28
+ * Gets the name of the `HelmetProperty`.
29
+ */
18
30
string getName ( ) { result = DataFlow:: PropWrite .super .getPropertyName ( ) }
19
31
20
- predicate isImportantSecuritySetting ( ) {
21
- // read from data extensions to allow enforcing custom settings
22
- // defaults are located in javascript/ql/lib/semmle/frameworks/helmet/Helmet.Required.Setting.model.yml
23
- requiredHelmetSecuritySetting ( this .getName ( ) )
24
- }
32
+ /**
33
+ * read from data extensions to allow enforcing custom settings
34
+ */
35
+ predicate isImportantSecuritySetting ( ) { requiredHelmetSecuritySetting ( this .getName ( ) ) }
25
36
}
26
37
38
+ /**
39
+ * defaults are located in `javascript/ql/lib/semmle/frameworks/helmet/Helmet.Required.Setting.model.yml`
40
+ */
27
41
extensible predicate requiredHelmetSecuritySetting ( string name ) ;
You can’t perform that action at this time.
0 commit comments