File tree 2 files changed +48
-213
lines changed
rules/javascript/security
2 files changed +48
-213
lines changed Original file line number Diff line number Diff line change @@ -108,148 +108,43 @@ utils:
108
108
kind : string_fragment
109
109
regex : ' ^express-session$'
110
110
111
- MATCH_SECRET_INSIDE_APP :
112
- kind : pair
113
- pattern : $C
114
- inside :
115
- stopBy : end
116
- kind : expression_statement
117
- all :
118
- - has :
119
- stopBy : end
120
- kind : call_expression
121
- all :
122
- - has :
123
- stopBy : end
124
- kind : member_expression
125
- all :
126
- - has :
127
- stopBy : end
128
- kind : identifier
129
- - has :
130
- stopBy : end
131
- kind : property_identifier
132
- regex : ' ^use$'
133
- - has :
134
- stopBy : end
135
- kind : arguments
136
- has :
137
- stopBy : end
138
- kind : call_expression
139
- all :
140
- - has :
141
- stopBy : end
142
- kind : identifier
143
- pattern : $T
144
- - has :
145
- stopBy : end
146
- kind : object
147
- has :
148
- stopBy : end
149
- kind : pair
150
- pattern : $C
151
- all :
152
- - has :
153
- stopBy : end
154
- kind : property_identifier
155
- pattern : $S
156
- - any :
157
- - has :
158
- stopBy : neighbor
159
- kind : identifier
160
- - has :
161
- stopBy : neighbor
162
- kind : string
163
-
164
- - any :
165
- - follows :
166
- stopBy : end
167
- kind : import_statement
168
- all :
169
- - has :
170
- stopBy : end
171
- kind : import_clause
172
- has :
173
- stopBy : neighbor
174
- kind : identifier
175
- pattern : $T
176
- - has :
111
+ MATCH_SECRET_with_Instance :
112
+ kind : pair
113
+ all :
114
+ - has :
115
+ stopBy : neighbor
116
+ kind : property_identifier
117
+ regex : ^secret$
118
+ - has :
119
+ stopBy : neighbor
120
+ kind : identifier
121
+ pattern : $SECRET
122
+ - inside :
123
+ stopBy : end
124
+ kind : expression_statement
125
+ follows :
126
+ stopBy : end
127
+ kind : lexical_declaration
128
+ has :
129
+ stopBy : end
130
+ kind : variable_declarator
131
+ all :
132
+ - has :
133
+ stopBy : neighbor
134
+ kind : identifier
135
+ pattern : $SECRET
136
+ - has :
137
+ stopBy : neighbor
138
+ kind : string
139
+ has :
177
140
stopBy : neighbor
178
- kind : string
179
- has :
180
- stopBy : neighbor
181
- kind : string_fragment
182
- regex : ' ^express-session$'
183
-
184
- - follows :
185
- stopBy : end
186
- kind : expression_statement
187
- has :
188
- stopBy : end
189
- kind : assignment_expression
190
- has :
191
- stopBy : end
192
- kind : call_expression
193
- all :
194
- - has :
195
- stopBy : neighbor
196
- kind : identifier
197
- regex : ' ^require$'
198
- - has :
199
- stopBy : end
200
- kind : arguments
201
- has :
202
- stopBy : neighbor
203
- kind : string
204
- has :
205
- stopBy : neighbor
206
- kind : string_fragment
207
- regex : ' ^express-session$'
208
-
209
- - follows :
210
- stopBy : end
211
- kind : import_statement
212
- has :
213
- stopBy : end
214
- kind : import_clause
215
- all :
216
- - has :
217
- stopBy : end
218
- kind : named_imports
219
- has :
220
- stopBy : end
221
- kind : import_specifier
222
- has :
223
- stopBy : end
224
- kind : identifier
225
- pattern : $T
226
-
227
- - follows :
228
- stopBy : end
229
- kind : import_statement
230
- all :
231
- - has :
232
- stopBy : neighbor
233
- kind : import_clause
234
- has :
235
- stopBy : neighbor
236
- kind : namespace_import
237
- has :
238
- stopBy : neighbor
239
- kind : identifier
240
- pattern : $T
241
- - has :
242
- stopBy : neighbor
243
- kind : string
244
- has :
245
- stopBy : neighbor
246
- kind : string_fragment
247
- regex : ' ^express-session$'
248
- rule :
141
+ kind : string_fragment
142
+ rule :
249
143
kind : pair
250
144
any :
251
145
- matches : MATCH_SECRET
252
- - matches : MATCH_SECRET_INSIDE_APP
146
+ - matches : MATCH_SECRET_with_Instance
147
+
253
148
constraints :
254
149
S :
255
150
regex : ' ^secret$'
Original file line number Diff line number Diff line change @@ -13,22 +13,6 @@ snapshots:
13
13
style : primary
14
14
start : 73
15
15
end : 82
16
- - source : app
17
- style : secondary
18
- start : 55
19
- end : 58
20
- - source : use
21
- style : secondary
22
- start : 59
23
- end : 62
24
- - source : app.use
25
- style : secondary
26
- start : 55
27
- end : 62
28
- - source : session
29
- style : secondary
30
- start : 63
31
- end : 70
32
16
- source : secret
33
17
style : secondary
34
18
start : 73
@@ -37,70 +21,26 @@ snapshots:
37
21
style : secondary
38
22
start : 81
39
23
end : 82
40
- - source : ' secret: a'
41
- style : secondary
42
- start : 73
43
- end : 82
44
- - source : |-
45
- {
46
- secret: a,
47
- resave: false,
48
- saveUninitialized: false,
49
- }
50
- style: secondary
51
- start: 71
52
- end: 126
53
- - source : |-
54
- session({
55
- secret: a,
56
- resave: false,
57
- saveUninitialized: false,
58
- })
59
- style: secondary
60
- start: 63
61
- end: 127
62
- - source : |-
63
- (session({
64
- secret: a,
65
- resave: false,
66
- saveUninitialized: false,
67
- }))
68
- style: secondary
69
- start: 62
70
- end: 128
71
- - source : |-
72
- app.use(session({
73
- secret: a,
74
- resave: false,
75
- saveUninitialized: false,
76
- }))
77
- style: secondary
78
- start: 55
79
- end: 128
80
- - source : session
81
- style : secondary
82
- start : 12
83
- end : 19
84
- - source : ' * as session'
24
+ - source : a
85
25
style : secondary
86
- start : 7
87
- end : 19
88
- - source : ' * as session '
26
+ start : 47
27
+ end : 48
28
+ - source : a
89
29
style : secondary
90
- start : 7
91
- end : 19
92
- - source : express-session
30
+ start : 52
31
+ end : 53
32
+ - source : ' '' a '' '
93
33
style : secondary
94
- start : 26
95
- end : 41
96
- - source : ' '' express-session '' '
34
+ start : 51
35
+ end : 54
36
+ - source : a = 'a '
97
37
style : secondary
98
- start : 25
99
- end : 42
100
- - source : import * as session from 'express-session '
38
+ start : 47
39
+ end : 54
40
+ - source : let a = 'a '
101
41
style : secondary
102
- start : 0
103
- end : 42
42
+ start : 43
43
+ end : 54
104
44
- source : |-
105
45
app.use(session({
106
46
secret: a,
You can’t perform that action at this time.
0 commit comments