circle-ir 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +200 -0
  3. package/configs/sinks/code_injection.yaml +672 -0
  4. package/configs/sinks/command.yaml +917 -0
  5. package/configs/sinks/deserialization.yaml +105 -0
  6. package/configs/sinks/ldap.yaml +136 -0
  7. package/configs/sinks/nodejs.json +629 -0
  8. package/configs/sinks/path.yaml +715 -0
  9. package/configs/sinks/python.json +501 -0
  10. package/configs/sinks/rust.json +339 -0
  11. package/configs/sinks/sql.yaml +233 -0
  12. package/configs/sinks/ssrf.yaml +160 -0
  13. package/configs/sinks/xpath.yaml +121 -0
  14. package/configs/sinks/xss.yaml +727 -0
  15. package/configs/sources/db_sources.yaml +90 -0
  16. package/configs/sources/env_sources.yaml +94 -0
  17. package/configs/sources/express.json +197 -0
  18. package/configs/sources/file_sources.yaml +164 -0
  19. package/configs/sources/http_sources.yaml +379 -0
  20. package/configs/sources/io_sources.yaml +519 -0
  21. package/configs/sources/network_sources.yaml +99 -0
  22. package/configs/sources/python.json +230 -0
  23. package/configs/sources/rust.json +286 -0
  24. package/configs/sources/spring.yaml +70 -0
  25. package/dist/analysis/advisory-db.d.ts +86 -0
  26. package/dist/analysis/advisory-db.js +104 -0
  27. package/dist/analysis/advisory-db.js.map +1 -0
  28. package/dist/analysis/cargo-parser.d.ts +42 -0
  29. package/dist/analysis/cargo-parser.js +102 -0
  30. package/dist/analysis/cargo-parser.js.map +1 -0
  31. package/dist/analysis/config-loader.d.ts +37 -0
  32. package/dist/analysis/config-loader.js +1561 -0
  33. package/dist/analysis/config-loader.js.map +1 -0
  34. package/dist/analysis/constant-propagation/ast-utils.d.ts +25 -0
  35. package/dist/analysis/constant-propagation/ast-utils.js +34 -0
  36. package/dist/analysis/constant-propagation/ast-utils.js.map +1 -0
  37. package/dist/analysis/constant-propagation/evaluator.d.ts +32 -0
  38. package/dist/analysis/constant-propagation/evaluator.js +296 -0
  39. package/dist/analysis/constant-propagation/evaluator.js.map +1 -0
  40. package/dist/analysis/constant-propagation/index.d.ts +62 -0
  41. package/dist/analysis/constant-propagation/index.js +152 -0
  42. package/dist/analysis/constant-propagation/index.js.map +1 -0
  43. package/dist/analysis/constant-propagation/patterns.d.ts +8 -0
  44. package/dist/analysis/constant-propagation/patterns.js +126 -0
  45. package/dist/analysis/constant-propagation/patterns.js.map +1 -0
  46. package/dist/analysis/constant-propagation/propagator.d.ts +180 -0
  47. package/dist/analysis/constant-propagation/propagator.js +1985 -0
  48. package/dist/analysis/constant-propagation/propagator.js.map +1 -0
  49. package/dist/analysis/constant-propagation/types.d.ts +63 -0
  50. package/dist/analysis/constant-propagation/types.js +5 -0
  51. package/dist/analysis/constant-propagation/types.js.map +1 -0
  52. package/dist/analysis/constant-propagation.d.ts +9 -0
  53. package/dist/analysis/constant-propagation.js +18 -0
  54. package/dist/analysis/constant-propagation.js.map +1 -0
  55. package/dist/analysis/dependency-scanner.d.ts +79 -0
  56. package/dist/analysis/dependency-scanner.js +122 -0
  57. package/dist/analysis/dependency-scanner.js.map +1 -0
  58. package/dist/analysis/dfg-verifier.d.ts +116 -0
  59. package/dist/analysis/dfg-verifier.js +399 -0
  60. package/dist/analysis/dfg-verifier.js.map +1 -0
  61. package/dist/analysis/findings.d.ts +11 -0
  62. package/dist/analysis/findings.js +228 -0
  63. package/dist/analysis/findings.js.map +1 -0
  64. package/dist/analysis/index.d.ts +16 -0
  65. package/dist/analysis/index.js +18 -0
  66. package/dist/analysis/index.js.map +1 -0
  67. package/dist/analysis/interprocedural.d.ts +99 -0
  68. package/dist/analysis/interprocedural.js +526 -0
  69. package/dist/analysis/interprocedural.js.map +1 -0
  70. package/dist/analysis/path-finder.d.ts +133 -0
  71. package/dist/analysis/path-finder.js +354 -0
  72. package/dist/analysis/path-finder.js.map +1 -0
  73. package/dist/analysis/rules.d.ts +75 -0
  74. package/dist/analysis/rules.js +332 -0
  75. package/dist/analysis/rules.js.map +1 -0
  76. package/dist/analysis/semver.d.ts +27 -0
  77. package/dist/analysis/semver.js +127 -0
  78. package/dist/analysis/semver.js.map +1 -0
  79. package/dist/analysis/taint-matcher.d.ts +15 -0
  80. package/dist/analysis/taint-matcher.js +634 -0
  81. package/dist/analysis/taint-matcher.js.map +1 -0
  82. package/dist/analysis/taint-propagation.d.ts +67 -0
  83. package/dist/analysis/taint-propagation.js +298 -0
  84. package/dist/analysis/taint-propagation.js.map +1 -0
  85. package/dist/analysis/unresolved.d.ts +14 -0
  86. package/dist/analysis/unresolved.js +202 -0
  87. package/dist/analysis/unresolved.js.map +1 -0
  88. package/dist/analyzer.d.ts +43 -0
  89. package/dist/analyzer.js +1010 -0
  90. package/dist/analyzer.js.map +1 -0
  91. package/dist/browser/circle-ir.js +16576 -0
  92. package/dist/browser.d.ts +38 -0
  93. package/dist/browser.js +38 -0
  94. package/dist/browser.js.map +1 -0
  95. package/dist/core/circle-ir-core.cjs +13626 -0
  96. package/dist/core/circle-ir-core.d.ts +59 -0
  97. package/dist/core/circle-ir-core.js +13591 -0
  98. package/dist/core/extractors/calls.d.ts +13 -0
  99. package/dist/core/extractors/calls.js +1429 -0
  100. package/dist/core/extractors/calls.js.map +1 -0
  101. package/dist/core/extractors/cfg.d.ts +9 -0
  102. package/dist/core/extractors/cfg.js +519 -0
  103. package/dist/core/extractors/cfg.js.map +1 -0
  104. package/dist/core/extractors/dfg.d.ts +12 -0
  105. package/dist/core/extractors/dfg.js +1081 -0
  106. package/dist/core/extractors/dfg.js.map +1 -0
  107. package/dist/core/extractors/exports.d.ts +14 -0
  108. package/dist/core/extractors/exports.js +80 -0
  109. package/dist/core/extractors/exports.js.map +1 -0
  110. package/dist/core/extractors/imports.d.ts +9 -0
  111. package/dist/core/extractors/imports.js +739 -0
  112. package/dist/core/extractors/imports.js.map +1 -0
  113. package/dist/core/extractors/index.d.ts +10 -0
  114. package/dist/core/extractors/index.js +11 -0
  115. package/dist/core/extractors/index.js.map +1 -0
  116. package/dist/core/extractors/meta.d.ts +10 -0
  117. package/dist/core/extractors/meta.js +109 -0
  118. package/dist/core/extractors/meta.js.map +1 -0
  119. package/dist/core/extractors/types.d.ts +10 -0
  120. package/dist/core/extractors/types.js +1479 -0
  121. package/dist/core/extractors/types.js.map +1 -0
  122. package/dist/core/index.d.ts +5 -0
  123. package/dist/core/index.js +8 -0
  124. package/dist/core/index.js.map +1 -0
  125. package/dist/core/parser.d.ts +84 -0
  126. package/dist/core/parser.js +250 -0
  127. package/dist/core/parser.js.map +1 -0
  128. package/dist/core-lib.d.ts +59 -0
  129. package/dist/core-lib.js +62 -0
  130. package/dist/core-lib.js.map +1 -0
  131. package/dist/index.d.ts +15 -0
  132. package/dist/index.js +20 -0
  133. package/dist/index.js.map +1 -0
  134. package/dist/languages/index.d.ts +11 -0
  135. package/dist/languages/index.js +14 -0
  136. package/dist/languages/index.js.map +1 -0
  137. package/dist/languages/plugins/base.d.ts +44 -0
  138. package/dist/languages/plugins/base.js +82 -0
  139. package/dist/languages/plugins/base.js.map +1 -0
  140. package/dist/languages/plugins/index.d.ts +14 -0
  141. package/dist/languages/plugins/index.js +25 -0
  142. package/dist/languages/plugins/index.js.map +1 -0
  143. package/dist/languages/plugins/java.d.ts +49 -0
  144. package/dist/languages/plugins/java.js +402 -0
  145. package/dist/languages/plugins/java.js.map +1 -0
  146. package/dist/languages/plugins/javascript.d.ts +48 -0
  147. package/dist/languages/plugins/javascript.js +445 -0
  148. package/dist/languages/plugins/javascript.js.map +1 -0
  149. package/dist/languages/plugins/python.d.ts +47 -0
  150. package/dist/languages/plugins/python.js +480 -0
  151. package/dist/languages/plugins/python.js.map +1 -0
  152. package/dist/languages/plugins/rust.d.ts +47 -0
  153. package/dist/languages/plugins/rust.js +405 -0
  154. package/dist/languages/plugins/rust.js.map +1 -0
  155. package/dist/languages/registry.d.ts +30 -0
  156. package/dist/languages/registry.js +80 -0
  157. package/dist/languages/registry.js.map +1 -0
  158. package/dist/languages/types.d.ts +184 -0
  159. package/dist/languages/types.js +8 -0
  160. package/dist/languages/types.js.map +1 -0
  161. package/dist/resolution/cross-file.d.ts +146 -0
  162. package/dist/resolution/cross-file.js +439 -0
  163. package/dist/resolution/cross-file.js.map +1 -0
  164. package/dist/resolution/index.d.ts +12 -0
  165. package/dist/resolution/index.js +10 -0
  166. package/dist/resolution/index.js.map +1 -0
  167. package/dist/resolution/symbol-table.d.ts +136 -0
  168. package/dist/resolution/symbol-table.js +336 -0
  169. package/dist/resolution/symbol-table.js.map +1 -0
  170. package/dist/resolution/type-hierarchy.d.ts +124 -0
  171. package/dist/resolution/type-hierarchy.js +515 -0
  172. package/dist/resolution/type-hierarchy.js.map +1 -0
  173. package/dist/types/config.d.ts +45 -0
  174. package/dist/types/config.js +5 -0
  175. package/dist/types/config.js.map +1 -0
  176. package/dist/types/index.d.ts +392 -0
  177. package/dist/types/index.js +7 -0
  178. package/dist/types/index.js.map +1 -0
  179. package/dist/utils/logger.d.ts +85 -0
  180. package/dist/utils/logger.js +198 -0
  181. package/dist/utils/logger.js.map +1 -0
  182. package/dist/wasm/tree-sitter-java.wasm +0 -0
  183. package/dist/wasm/tree-sitter-javascript.wasm +0 -0
  184. package/dist/wasm/tree-sitter-python.wasm +0 -0
  185. package/dist/wasm/tree-sitter-rust.wasm +0 -0
  186. package/dist/wasm/web-tree-sitter.wasm +0 -0
  187. package/docs/SPEC.md +1021 -0
  188. package/examples/browser-example.html +610 -0
  189. package/examples/node-example.ts +215 -0
  190. package/package.json +107 -0
  191. package/wasm/tree-sitter-java.wasm +0 -0
  192. package/wasm/tree-sitter-javascript.wasm +0 -0
  193. package/wasm/tree-sitter-python.wasm +0 -0
  194. package/wasm/tree-sitter-rust.wasm +0 -0
@@ -0,0 +1,629 @@
1
+ {
2
+ "sinks": [
3
+ {
4
+ "method": "exec",
5
+ "class": "child_process",
6
+ "type": "command_injection",
7
+ "cwe": "CWE-78",
8
+ "severity": "critical",
9
+ "arg_positions": [0],
10
+ "note": "Command execution - extremely dangerous with user input"
11
+ },
12
+ {
13
+ "method": "execSync",
14
+ "class": "child_process",
15
+ "type": "command_injection",
16
+ "cwe": "CWE-78",
17
+ "severity": "critical",
18
+ "arg_positions": [0],
19
+ "note": "Synchronous command execution"
20
+ },
21
+ {
22
+ "method": "spawn",
23
+ "class": "child_process",
24
+ "type": "command_injection",
25
+ "cwe": "CWE-78",
26
+ "severity": "critical",
27
+ "arg_positions": [0, 1],
28
+ "note": "Process spawn - arg[0] is command, arg[1] is args array"
29
+ },
30
+ {
31
+ "method": "spawnSync",
32
+ "class": "child_process",
33
+ "type": "command_injection",
34
+ "cwe": "CWE-78",
35
+ "severity": "critical",
36
+ "arg_positions": [0, 1],
37
+ "note": "Synchronous process spawn"
38
+ },
39
+ {
40
+ "method": "execFile",
41
+ "class": "child_process",
42
+ "type": "command_injection",
43
+ "cwe": "CWE-78",
44
+ "severity": "critical",
45
+ "arg_positions": [0, 1],
46
+ "note": "Execute file with arguments"
47
+ },
48
+ {
49
+ "method": "fork",
50
+ "class": "child_process",
51
+ "type": "command_injection",
52
+ "cwe": "CWE-78",
53
+ "severity": "high",
54
+ "arg_positions": [0],
55
+ "note": "Fork new Node.js process"
56
+ },
57
+ {
58
+ "method": "query",
59
+ "class": "mysql",
60
+ "type": "sql_injection",
61
+ "cwe": "CWE-89",
62
+ "severity": "critical",
63
+ "arg_positions": [0],
64
+ "note": "MySQL query - use parameterized queries"
65
+ },
66
+ {
67
+ "method": "query",
68
+ "class": "Connection",
69
+ "type": "sql_injection",
70
+ "cwe": "CWE-89",
71
+ "severity": "critical",
72
+ "arg_positions": [0],
73
+ "note": "Database query method"
74
+ },
75
+ {
76
+ "method": "query",
77
+ "class": "Pool",
78
+ "type": "sql_injection",
79
+ "cwe": "CWE-89",
80
+ "severity": "critical",
81
+ "arg_positions": [0],
82
+ "note": "Database pool query"
83
+ },
84
+ {
85
+ "method": "raw",
86
+ "class": "knex",
87
+ "type": "sql_injection",
88
+ "cwe": "CWE-89",
89
+ "severity": "critical",
90
+ "arg_positions": [0],
91
+ "note": "Knex raw SQL query"
92
+ },
93
+ {
94
+ "method": "$queryRaw",
95
+ "class": "prisma",
96
+ "type": "sql_injection",
97
+ "cwe": "CWE-89",
98
+ "severity": "critical",
99
+ "arg_positions": [0],
100
+ "note": "Prisma raw query"
101
+ },
102
+ {
103
+ "method": "readFile",
104
+ "class": "fs",
105
+ "type": "path_traversal",
106
+ "cwe": "CWE-22",
107
+ "severity": "critical",
108
+ "arg_positions": [0],
109
+ "note": "File read - validate path before use"
110
+ },
111
+ {
112
+ "method": "readFileSync",
113
+ "class": "fs",
114
+ "type": "path_traversal",
115
+ "cwe": "CWE-22",
116
+ "severity": "critical",
117
+ "arg_positions": [0],
118
+ "note": "Synchronous file read"
119
+ },
120
+ {
121
+ "method": "writeFile",
122
+ "class": "fs",
123
+ "type": "path_traversal",
124
+ "cwe": "CWE-22",
125
+ "severity": "critical",
126
+ "arg_positions": [0],
127
+ "note": "File write - validate path before use"
128
+ },
129
+ {
130
+ "method": "writeFileSync",
131
+ "class": "fs",
132
+ "type": "path_traversal",
133
+ "cwe": "CWE-22",
134
+ "severity": "critical",
135
+ "arg_positions": [0],
136
+ "note": "Synchronous file write"
137
+ },
138
+ {
139
+ "method": "appendFile",
140
+ "class": "fs",
141
+ "type": "path_traversal",
142
+ "cwe": "CWE-22",
143
+ "severity": "critical",
144
+ "arg_positions": [0],
145
+ "note": "File append operation"
146
+ },
147
+ {
148
+ "method": "unlink",
149
+ "class": "fs",
150
+ "type": "path_traversal",
151
+ "cwe": "CWE-22",
152
+ "severity": "critical",
153
+ "arg_positions": [0],
154
+ "note": "File deletion"
155
+ },
156
+ {
157
+ "method": "createReadStream",
158
+ "class": "fs",
159
+ "type": "path_traversal",
160
+ "cwe": "CWE-22",
161
+ "severity": "critical",
162
+ "arg_positions": [0],
163
+ "note": "Create read stream from file"
164
+ },
165
+ {
166
+ "method": "createWriteStream",
167
+ "class": "fs",
168
+ "type": "path_traversal",
169
+ "cwe": "CWE-22",
170
+ "severity": "critical",
171
+ "arg_positions": [0],
172
+ "note": "Create write stream to file"
173
+ },
174
+ {
175
+ "method": "send",
176
+ "class": "Response",
177
+ "type": "xss",
178
+ "cwe": "CWE-79",
179
+ "severity": "high",
180
+ "arg_positions": [0],
181
+ "note": "Express response - HTML content may be vulnerable to XSS"
182
+ },
183
+ {
184
+ "method": "html",
185
+ "class": "Response",
186
+ "type": "xss",
187
+ "cwe": "CWE-79",
188
+ "severity": "critical",
189
+ "arg_positions": [0],
190
+ "note": "Express HTML response - directly renders HTML"
191
+ },
192
+ {
193
+ "method": "write",
194
+ "class": "Response",
195
+ "type": "xss",
196
+ "cwe": "CWE-79",
197
+ "severity": "high",
198
+ "arg_positions": [0],
199
+ "note": "Response write - may render HTML"
200
+ },
201
+ {
202
+ "method": "end",
203
+ "class": "Response",
204
+ "type": "xss",
205
+ "cwe": "CWE-79",
206
+ "severity": "high",
207
+ "arg_positions": [0],
208
+ "note": "Response end with data"
209
+ },
210
+ {
211
+ "method": "render",
212
+ "class": "Response",
213
+ "type": "xss",
214
+ "cwe": "CWE-79",
215
+ "severity": "high",
216
+ "arg_positions": [1],
217
+ "note": "Template render - second arg is data object"
218
+ },
219
+ {
220
+ "method": "eval",
221
+ "type": "code_injection",
222
+ "cwe": "CWE-94",
223
+ "severity": "critical",
224
+ "arg_positions": [0],
225
+ "note": "Never use eval with user input"
226
+ },
227
+ {
228
+ "method": "Function",
229
+ "class": "constructor",
230
+ "type": "code_injection",
231
+ "cwe": "CWE-94",
232
+ "severity": "critical",
233
+ "arg_positions": [0],
234
+ "note": "Function constructor is like eval"
235
+ },
236
+ {
237
+ "method": "setTimeout",
238
+ "type": "code_injection",
239
+ "cwe": "CWE-94",
240
+ "severity": "critical",
241
+ "arg_positions": [0],
242
+ "note": "setTimeout with string argument evaluates code"
243
+ },
244
+ {
245
+ "method": "setInterval",
246
+ "type": "code_injection",
247
+ "cwe": "CWE-94",
248
+ "severity": "critical",
249
+ "arg_positions": [0],
250
+ "note": "setInterval with string argument evaluates code"
251
+ },
252
+ {
253
+ "method": "fetch",
254
+ "type": "ssrf",
255
+ "cwe": "CWE-918",
256
+ "severity": "high",
257
+ "arg_positions": [0],
258
+ "note": "HTTP fetch - validate URL to prevent SSRF"
259
+ },
260
+ {
261
+ "method": "get",
262
+ "class": "axios",
263
+ "type": "ssrf",
264
+ "cwe": "CWE-918",
265
+ "severity": "high",
266
+ "arg_positions": [0],
267
+ "note": "Axios GET request"
268
+ },
269
+ {
270
+ "method": "post",
271
+ "class": "axios",
272
+ "type": "ssrf",
273
+ "cwe": "CWE-918",
274
+ "severity": "high",
275
+ "arg_positions": [0],
276
+ "note": "Axios POST request"
277
+ },
278
+ {
279
+ "method": "request",
280
+ "class": "axios",
281
+ "type": "ssrf",
282
+ "cwe": "CWE-918",
283
+ "severity": "high",
284
+ "arg_positions": [0],
285
+ "note": "Axios request"
286
+ },
287
+ {
288
+ "method": "request",
289
+ "class": "http",
290
+ "type": "ssrf",
291
+ "cwe": "CWE-918",
292
+ "severity": "high",
293
+ "arg_positions": [0],
294
+ "note": "Node.js HTTP request"
295
+ },
296
+ {
297
+ "method": "request",
298
+ "class": "https",
299
+ "type": "ssrf",
300
+ "cwe": "CWE-918",
301
+ "severity": "high",
302
+ "arg_positions": [0],
303
+ "note": "Node.js HTTPS request"
304
+ },
305
+ {
306
+ "method": "redirect",
307
+ "class": "Response",
308
+ "type": "open_redirect",
309
+ "cwe": "CWE-601",
310
+ "severity": "medium",
311
+ "arg_positions": [0],
312
+ "note": "Express redirect - validate URL to prevent open redirect"
313
+ },
314
+ {
315
+ "method": "join",
316
+ "class": "path",
317
+ "type": "path_traversal",
318
+ "cwe": "CWE-22",
319
+ "severity": "high",
320
+ "arg_positions": [0, 1],
321
+ "note": "Path join - may allow path traversal if not validated"
322
+ },
323
+ {
324
+ "method": "resolve",
325
+ "class": "path",
326
+ "type": "path_traversal",
327
+ "cwe": "CWE-22",
328
+ "severity": "high",
329
+ "arg_positions": [0, 1],
330
+ "note": "Path resolve - may allow path traversal if not validated"
331
+ },
332
+ {
333
+ "method": "lookup",
334
+ "class": "dns",
335
+ "type": "ssrf",
336
+ "cwe": "CWE-918",
337
+ "severity": "high",
338
+ "arg_positions": [0],
339
+ "note": "DNS lookup - can be used for DNS rebinding attacks"
340
+ },
341
+ {
342
+ "method": "resolve",
343
+ "class": "dns",
344
+ "type": "ssrf",
345
+ "cwe": "CWE-918",
346
+ "severity": "high",
347
+ "arg_positions": [0],
348
+ "note": "DNS resolve"
349
+ },
350
+ {
351
+ "method": "connect",
352
+ "class": "net",
353
+ "type": "ssrf",
354
+ "cwe": "CWE-918",
355
+ "severity": "high",
356
+ "arg_positions": [0],
357
+ "note": "TCP connection - validate host/port"
358
+ },
359
+ {
360
+ "method": "createConnection",
361
+ "class": "net",
362
+ "type": "ssrf",
363
+ "cwe": "CWE-918",
364
+ "severity": "high",
365
+ "arg_positions": [0],
366
+ "note": "Create TCP connection"
367
+ },
368
+ {
369
+ "method": "runInContext",
370
+ "class": "vm",
371
+ "type": "code_injection",
372
+ "cwe": "CWE-94",
373
+ "severity": "critical",
374
+ "arg_positions": [0],
375
+ "note": "VM code execution - dangerous with user input"
376
+ },
377
+ {
378
+ "method": "runInNewContext",
379
+ "class": "vm",
380
+ "type": "code_injection",
381
+ "cwe": "CWE-94",
382
+ "severity": "critical",
383
+ "arg_positions": [0],
384
+ "note": "VM code execution in new context"
385
+ },
386
+ {
387
+ "method": "runInThisContext",
388
+ "class": "vm",
389
+ "type": "code_injection",
390
+ "cwe": "CWE-94",
391
+ "severity": "critical",
392
+ "arg_positions": [0],
393
+ "note": "VM code execution in current context"
394
+ },
395
+ {
396
+ "method": "compileFunction",
397
+ "class": "vm",
398
+ "type": "code_injection",
399
+ "cwe": "CWE-94",
400
+ "severity": "critical",
401
+ "arg_positions": [0],
402
+ "note": "Compile function from code string"
403
+ },
404
+ {
405
+ "method": "find",
406
+ "class": "MongoDB",
407
+ "type": "nosql_injection",
408
+ "cwe": "CWE-943",
409
+ "severity": "critical",
410
+ "arg_positions": [0],
411
+ "note": "MongoDB find - beware of NoSQL injection via object operators"
412
+ },
413
+ {
414
+ "method": "findOne",
415
+ "class": "MongoDB",
416
+ "type": "nosql_injection",
417
+ "cwe": "CWE-943",
418
+ "severity": "critical",
419
+ "arg_positions": [0],
420
+ "note": "MongoDB findOne"
421
+ },
422
+ {
423
+ "method": "findOneAndUpdate",
424
+ "class": "MongoDB",
425
+ "type": "nosql_injection",
426
+ "cwe": "CWE-943",
427
+ "severity": "critical",
428
+ "arg_positions": [0, 1],
429
+ "note": "MongoDB findOneAndUpdate"
430
+ },
431
+ {
432
+ "method": "updateOne",
433
+ "class": "MongoDB",
434
+ "type": "nosql_injection",
435
+ "cwe": "CWE-943",
436
+ "severity": "critical",
437
+ "arg_positions": [0, 1],
438
+ "note": "MongoDB updateOne"
439
+ },
440
+ {
441
+ "method": "deleteOne",
442
+ "class": "MongoDB",
443
+ "type": "nosql_injection",
444
+ "cwe": "CWE-943",
445
+ "severity": "critical",
446
+ "arg_positions": [0],
447
+ "note": "MongoDB deleteOne"
448
+ },
449
+ {
450
+ "method": "aggregate",
451
+ "class": "MongoDB",
452
+ "type": "nosql_injection",
453
+ "cwe": "CWE-943",
454
+ "severity": "critical",
455
+ "arg_positions": [0],
456
+ "note": "MongoDB aggregation pipeline"
457
+ },
458
+ {
459
+ "method": "$where",
460
+ "class": "MongoDB",
461
+ "type": "code_injection",
462
+ "cwe": "CWE-94",
463
+ "severity": "critical",
464
+ "arg_positions": [0],
465
+ "note": "MongoDB $where operator - executes JavaScript"
466
+ },
467
+ {
468
+ "method": "deserialize",
469
+ "type": "deserialization",
470
+ "cwe": "CWE-502",
471
+ "severity": "critical",
472
+ "arg_positions": [0],
473
+ "note": "Object deserialization - dangerous with untrusted data"
474
+ },
475
+ {
476
+ "method": "parse",
477
+ "class": "JSON",
478
+ "type": "deserialization",
479
+ "cwe": "CWE-502",
480
+ "severity": "medium",
481
+ "arg_positions": [0],
482
+ "note": "JSON parse with reviver can be dangerous"
483
+ },
484
+ {
485
+ "method": "compile",
486
+ "class": "Handlebars",
487
+ "type": "template_injection",
488
+ "cwe": "CWE-94",
489
+ "severity": "critical",
490
+ "arg_positions": [0],
491
+ "note": "Handlebars template compilation - SSTI risk"
492
+ },
493
+ {
494
+ "method": "compile",
495
+ "class": "pug",
496
+ "type": "template_injection",
497
+ "cwe": "CWE-94",
498
+ "severity": "critical",
499
+ "arg_positions": [0],
500
+ "note": "Pug/Jade template compilation - SSTI risk"
501
+ },
502
+ {
503
+ "method": "compile",
504
+ "class": "ejs",
505
+ "type": "template_injection",
506
+ "cwe": "CWE-94",
507
+ "severity": "critical",
508
+ "arg_positions": [0],
509
+ "note": "EJS template compilation - SSTI risk"
510
+ },
511
+ {
512
+ "method": "setHeader",
513
+ "class": "Response",
514
+ "type": "header_injection",
515
+ "cwe": "CWE-113",
516
+ "severity": "medium",
517
+ "arg_positions": [1],
518
+ "note": "HTTP header injection if value contains CRLF"
519
+ },
520
+ {
521
+ "method": "cookie",
522
+ "class": "Response",
523
+ "type": "header_injection",
524
+ "cwe": "CWE-113",
525
+ "severity": "medium",
526
+ "arg_positions": [1],
527
+ "note": "Cookie value injection"
528
+ }
529
+ ],
530
+ "sanitizers": [
531
+ {
532
+ "method": "escape",
533
+ "class": "validator",
534
+ "removes": ["xss"],
535
+ "note": "Validator.js escape function"
536
+ },
537
+ {
538
+ "method": "escapeHtml",
539
+ "removes": ["xss"],
540
+ "note": "HTML escape function"
541
+ },
542
+ {
543
+ "method": "sanitize",
544
+ "removes": ["xss", "sql_injection"],
545
+ "note": "Generic sanitization"
546
+ },
547
+ {
548
+ "method": "normalize",
549
+ "class": "path",
550
+ "removes": ["path_traversal"],
551
+ "note": "Path normalization (still needs validation)"
552
+ },
553
+ {
554
+ "method": "basename",
555
+ "class": "path",
556
+ "removes": ["path_traversal"],
557
+ "note": "Returns filename only"
558
+ },
559
+ {
560
+ "method": "escape",
561
+ "class": "mysql",
562
+ "removes": ["sql_injection"],
563
+ "note": "MySQL escape function"
564
+ },
565
+ {
566
+ "method": "escapeId",
567
+ "class": "mysql",
568
+ "removes": ["sql_injection"],
569
+ "note": "MySQL identifier escape"
570
+ },
571
+ {
572
+ "method": "createHash",
573
+ "class": "crypto",
574
+ "removes": ["plain_text"],
575
+ "note": "Hashing function (use for integrity, not encryption)"
576
+ },
577
+ {
578
+ "method": "parseInt",
579
+ "removes": ["sql_injection", "command_injection"],
580
+ "note": "Converts to integer - safe for numeric values"
581
+ },
582
+ {
583
+ "method": "parseFloat",
584
+ "removes": ["sql_injection", "command_injection"],
585
+ "note": "Converts to float - safe for numeric values"
586
+ },
587
+ {
588
+ "method": "Number",
589
+ "removes": ["sql_injection", "command_injection"],
590
+ "note": "Number constructor - safe for numeric values"
591
+ },
592
+ {
593
+ "method": "encodeURIComponent",
594
+ "removes": ["xss", "open_redirect"],
595
+ "note": "URL encoding - safe for URL parameters"
596
+ },
597
+ {
598
+ "method": "encodeURI",
599
+ "removes": ["open_redirect"],
600
+ "note": "URL encoding"
601
+ },
602
+ {
603
+ "method": "createCipheriv",
604
+ "class": "crypto",
605
+ "removes": ["plain_text"],
606
+ "note": "Encryption function"
607
+ },
608
+ {
609
+ "method": "DOMPurify.sanitize",
610
+ "removes": ["xss"],
611
+ "note": "DOMPurify HTML sanitization"
612
+ },
613
+ {
614
+ "method": "xss",
615
+ "removes": ["xss"],
616
+ "note": "xss npm package sanitization"
617
+ },
618
+ {
619
+ "method": "stripTags",
620
+ "removes": ["xss"],
621
+ "note": "HTML tag stripping"
622
+ },
623
+ {
624
+ "method": "toString",
625
+ "removes": ["nosql_injection"],
626
+ "note": "Convert to string - prevents NoSQL operator injection"
627
+ }
628
+ ]
629
+ }