File tree 2 files changed +19
-192
lines changed
rules/javascript/security
2 files changed +19
-192
lines changed Original file line number Diff line number Diff line change @@ -41,73 +41,14 @@ utils:
41
41
stopBy : end
42
42
kind : string_fragment
43
43
44
- - any :
45
- - follows :
46
- stopBy : end
47
- kind : import_statement
48
- all :
49
- - has :
50
- stopBy : end
51
- kind : import_clause
52
- has :
53
- stopBy : neighbor
54
- kind : identifier
55
- pattern : $T
56
- - has :
57
- stopBy : neighbor
58
- kind : string
59
- has :
60
- stopBy : neighbor
61
- kind : string_fragment
62
- regex : ' ^express-session$'
63
-
64
- - follows :
65
- stopBy : end
66
- kind : expression_statement
67
- has :
68
- stopBy : end
69
- kind : assignment_expression
70
- has :
71
- stopBy : end
72
- kind : call_expression
73
- all :
74
- - has :
75
- stopBy : neighbor
76
- kind : identifier
77
- regex : ' ^require$'
78
- - has :
79
- stopBy : end
80
- kind : arguments
81
- has :
82
- stopBy : neighbor
83
- kind : string
84
- has :
85
- stopBy : neighbor
86
- kind : string_fragment
87
- regex : ' ^express-session$'
88
-
89
- - follows :
90
- stopBy : end
91
- kind : import_statement
92
- all :
93
- - has :
94
- stopBy : neighbor
95
- kind : import_clause
96
- has :
97
- stopBy : neighbor
98
- kind : namespace_import
99
- has :
100
- stopBy : neighbor
101
- kind : identifier
102
- pattern : $T
103
- - has :
104
- stopBy : neighbor
105
- kind : string
106
- has :
107
- stopBy : neighbor
108
- kind : string_fragment
109
- regex : ' ^express-session$'
110
-
44
+ - follows :
45
+ stopBy : end
46
+ kind : import_statement
47
+ any :
48
+ - pattern : import session from 'express'
49
+ - pattern : import session from 'express-session'
50
+ - pattern : import {session} from 'express-session'
51
+ - pattern : import * as session from 'express-session'
111
52
MATCH_SECRET_with_Instance :
112
53
kind : pair
113
54
all :
@@ -144,75 +85,21 @@ utils:
144
85
any :
145
86
- kind : lexical_declaration
146
87
- kind : expression_statement
147
- any :
148
- - follows :
149
- stopBy : end
150
- kind : import_statement
151
- all :
152
- - has :
153
- stopBy : end
154
- kind : import_clause
155
- has :
156
- stopBy : neighbor
157
- kind : identifier
158
- pattern : $T
159
- - has :
160
- stopBy : neighbor
161
- kind : string
162
- has :
163
- stopBy : neighbor
164
- kind : string_fragment
165
- regex : ' ^express-session$'
166
- - follows :
167
- stopBy : end
168
- kind : expression_statement
169
- has :
170
- stopBy : end
171
- kind : assignment_expression
172
- has :
173
- stopBy : end
174
- kind : call_expression
175
- all :
176
- - has :
177
- stopBy : neighbor
178
- kind : identifier
179
- regex : ' ^require$'
180
- - has :
181
- stopBy : end
182
- kind : arguments
183
- has :
184
- stopBy : neighbor
185
- kind : string
186
- has :
187
- stopBy : neighbor
188
- kind : string_fragment
189
- regex : ' ^express-session$'
190
- - follows :
191
- stopBy : end
192
- kind : import_statement
193
- all :
194
- - has :
195
- stopBy : neighbor
196
- kind : import_clause
197
- has :
198
- stopBy : neighbor
199
- kind : namespace_import
200
- has :
201
- stopBy : neighbor
202
- kind : identifier
203
- pattern : $T
204
- - has :
205
- stopBy : neighbor
206
- kind : string
207
- has :
208
- stopBy : neighbor
209
- kind : string_fragment
210
- regex : ' ^express-session$'
88
+ follows :
89
+ stopBy : end
90
+ kind : import_statement
91
+ any :
92
+ - pattern : import session from 'express'
93
+ - pattern : import session from 'express-session'
94
+ - pattern : import {session} from 'express-session'
95
+ - pattern : import * as session from 'express-session'
96
+
211
97
rule :
212
98
kind : pair
213
99
any :
214
100
- matches : MATCH_SECRET
215
101
- matches : MATCH_SECRET_with_Instance
102
+
216
103
constraints :
217
104
S :
218
- regex : ' ^secret$'
105
+ regex : ' ^secret$'
Original file line number Diff line number Diff line change @@ -50,26 +50,6 @@ snapshots:
50
50
style: secondary
51
51
start: 55
52
52
end: 129
53
- - source : session
54
- style : secondary
55
- start : 12
56
- end : 19
57
- - source : ' * as session'
58
- style : secondary
59
- start : 7
60
- end : 19
61
- - source : ' * as session'
62
- style : secondary
63
- start : 7
64
- end : 19
65
- - source : express-session
66
- style : secondary
67
- start : 26
68
- end : 41
69
- - source : ' '' express-session'' '
70
- style : secondary
71
- start : 25
72
- end : 42
73
53
- source : import * as session from 'express-session'
74
54
style : secondary
75
55
start : 0
@@ -129,26 +109,6 @@ snapshots:
129
109
style: secondary
130
110
start: 47
131
111
end: 113
132
- - source : session
133
- style : secondary
134
- start : 12
135
- end : 19
136
- - source : ' * as session'
137
- style : secondary
138
- start : 7
139
- end : 19
140
- - source : ' * as session'
141
- style : secondary
142
- start : 7
143
- end : 19
144
- - source : express-session
145
- style : secondary
146
- start : 26
147
- end : 41
148
- - source : ' '' express-session'' '
149
- style : secondary
150
- start : 25
151
- end : 42
152
112
- source : import * as session from 'express-session'
153
113
style : secondary
154
114
start : 0
@@ -208,26 +168,6 @@ snapshots:
208
168
style: secondary
209
169
start: 47
210
170
end: 116
211
- - source : session
212
- style : secondary
213
- start : 12
214
- end : 19
215
- - source : ' * as session'
216
- style : secondary
217
- start : 7
218
- end : 19
219
- - source : ' * as session'
220
- style : secondary
221
- start : 7
222
- end : 19
223
- - source : express-session
224
- style : secondary
225
- start : 26
226
- end : 41
227
- - source : ' '' express-session'' '
228
- style : secondary
229
- start : 25
230
- end : 42
231
171
- source : import * as session from 'express-session'
232
172
style : secondary
233
173
start : 0
You can’t perform that action at this time.
0 commit comments