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,230 @@
1
+ {
2
+ "sources": [
3
+ {
4
+ "method": "args.get",
5
+ "class": "request",
6
+ "type": "http_param",
7
+ "severity": "high",
8
+ "return_tainted": true,
9
+ "note": "Flask request.args.get() - query string parameter"
10
+ },
11
+ {
12
+ "method": "form.get",
13
+ "class": "request",
14
+ "type": "http_param",
15
+ "severity": "high",
16
+ "return_tainted": true,
17
+ "note": "Flask request.form.get() - POST form parameter"
18
+ },
19
+ {
20
+ "field": "json",
21
+ "class": "request",
22
+ "type": "http_body",
23
+ "severity": "high",
24
+ "return_tainted": true,
25
+ "note": "Flask request.json - parsed JSON body"
26
+ },
27
+ {
28
+ "field": "data",
29
+ "class": "request",
30
+ "type": "http_body",
31
+ "severity": "high",
32
+ "return_tainted": true,
33
+ "note": "Flask request.data - raw request body"
34
+ },
35
+ {
36
+ "method": "headers.get",
37
+ "class": "request",
38
+ "type": "http_header",
39
+ "severity": "high",
40
+ "return_tainted": true,
41
+ "note": "Flask request.headers.get() - HTTP header value"
42
+ },
43
+ {
44
+ "method": "cookies.get",
45
+ "class": "request",
46
+ "type": "http_cookie",
47
+ "severity": "high",
48
+ "return_tainted": true,
49
+ "note": "Flask request.cookies.get() - cookie value"
50
+ },
51
+ {
52
+ "field": "path",
53
+ "class": "request",
54
+ "type": "http_path",
55
+ "severity": "medium",
56
+ "return_tainted": true,
57
+ "note": "Flask request.path - URL path"
58
+ },
59
+ {
60
+ "field": "query_string",
61
+ "class": "request",
62
+ "type": "http_query",
63
+ "severity": "high",
64
+ "return_tainted": true,
65
+ "note": "Flask request.query_string - raw query string"
66
+ },
67
+ {
68
+ "method": "GET.get",
69
+ "class": "request",
70
+ "type": "http_param",
71
+ "severity": "high",
72
+ "return_tainted": true,
73
+ "note": "Django request.GET.get() - query string parameter"
74
+ },
75
+ {
76
+ "method": "POST.get",
77
+ "class": "request",
78
+ "type": "http_param",
79
+ "severity": "high",
80
+ "return_tainted": true,
81
+ "note": "Django request.POST.get() - POST form parameter"
82
+ },
83
+ {
84
+ "field": "body",
85
+ "class": "request",
86
+ "type": "http_body",
87
+ "severity": "high",
88
+ "return_tainted": true,
89
+ "note": "Django request.body - raw request body"
90
+ },
91
+ {
92
+ "method": "META.get",
93
+ "class": "request",
94
+ "type": "http_header",
95
+ "severity": "high",
96
+ "return_tainted": true,
97
+ "note": "Django request.META.get() - HTTP headers and server info"
98
+ },
99
+ {
100
+ "method": "COOKIES.get",
101
+ "class": "request",
102
+ "type": "http_cookie",
103
+ "severity": "high",
104
+ "return_tainted": true,
105
+ "note": "Django request.COOKIES.get() - cookie value"
106
+ },
107
+ {
108
+ "field": "path_info",
109
+ "class": "request",
110
+ "type": "http_path",
111
+ "severity": "medium",
112
+ "return_tainted": true,
113
+ "note": "Django request.path_info - URL path"
114
+ },
115
+ {
116
+ "method": "get",
117
+ "class": "environ",
118
+ "type": "env_input",
119
+ "severity": "medium",
120
+ "return_tainted": true,
121
+ "note": "os.environ.get() - environment variable"
122
+ },
123
+ {
124
+ "method": "getenv",
125
+ "class": "os",
126
+ "type": "env_input",
127
+ "severity": "medium",
128
+ "return_tainted": true,
129
+ "note": "os.getenv() - environment variable"
130
+ },
131
+ {
132
+ "method": "input",
133
+ "class": null,
134
+ "type": "io_input",
135
+ "severity": "high",
136
+ "return_tainted": true,
137
+ "note": "input() - user console input"
138
+ },
139
+ {
140
+ "method": "read",
141
+ "class": null,
142
+ "type": "file_input",
143
+ "severity": "medium",
144
+ "return_tainted": true,
145
+ "note": "file.read() - file content"
146
+ },
147
+ {
148
+ "method": "readline",
149
+ "class": null,
150
+ "type": "file_input",
151
+ "severity": "medium",
152
+ "return_tainted": true,
153
+ "note": "file.readline() - single line from file"
154
+ },
155
+ {
156
+ "method": "readlines",
157
+ "class": null,
158
+ "type": "file_input",
159
+ "severity": "medium",
160
+ "return_tainted": true,
161
+ "note": "file.readlines() - all lines from file"
162
+ },
163
+ {
164
+ "method": "fetchone",
165
+ "class": null,
166
+ "type": "db_input",
167
+ "severity": "medium",
168
+ "return_tainted": true,
169
+ "note": "cursor.fetchone() - database row"
170
+ },
171
+ {
172
+ "method": "fetchall",
173
+ "class": null,
174
+ "type": "db_input",
175
+ "severity": "medium",
176
+ "return_tainted": true,
177
+ "note": "cursor.fetchall() - database rows"
178
+ },
179
+ {
180
+ "method": "fetchmany",
181
+ "class": null,
182
+ "type": "db_input",
183
+ "severity": "medium",
184
+ "return_tainted": true,
185
+ "note": "cursor.fetchmany() - database rows"
186
+ },
187
+ {
188
+ "method": "recv",
189
+ "class": "socket",
190
+ "type": "network_input",
191
+ "severity": "high",
192
+ "return_tainted": true,
193
+ "note": "socket.recv() - network data"
194
+ },
195
+ {
196
+ "method": "recvfrom",
197
+ "class": "socket",
198
+ "type": "network_input",
199
+ "severity": "high",
200
+ "return_tainted": true,
201
+ "note": "socket.recvfrom() - network data with address"
202
+ }
203
+ ],
204
+ "annotations": [
205
+ {
206
+ "annotation": "route",
207
+ "type": "http_param",
208
+ "severity": "high",
209
+ "note": "Flask @app.route() decorated function parameters"
210
+ },
211
+ {
212
+ "annotation": "get",
213
+ "type": "http_param",
214
+ "severity": "high",
215
+ "note": "Flask @app.get() decorated function parameters"
216
+ },
217
+ {
218
+ "annotation": "post",
219
+ "type": "http_body",
220
+ "severity": "high",
221
+ "note": "Flask @app.post() decorated function parameters"
222
+ },
223
+ {
224
+ "annotation": "api_view",
225
+ "type": "http_param",
226
+ "severity": "high",
227
+ "note": "Django REST framework @api_view() decorated function"
228
+ }
229
+ ]
230
+ }
@@ -0,0 +1,286 @@
1
+ {
2
+ "name": "Rust Sources",
3
+ "description": "Taint sources for Rust web frameworks and standard library",
4
+ "sources": [
5
+ {
6
+ "method": "query_string",
7
+ "class": "HttpRequest",
8
+ "type": "http_param",
9
+ "severity": "high",
10
+ "return_tainted": true,
11
+ "framework": "actix-web"
12
+ },
13
+ {
14
+ "method": "path",
15
+ "class": "Path",
16
+ "type": "http_param",
17
+ "severity": "high",
18
+ "return_tainted": true,
19
+ "framework": "actix-web"
20
+ },
21
+ {
22
+ "method": "into_inner",
23
+ "class": "Path",
24
+ "type": "http_param",
25
+ "severity": "high",
26
+ "return_tainted": true,
27
+ "framework": "actix-web"
28
+ },
29
+ {
30
+ "method": "into_inner",
31
+ "class": "Query",
32
+ "type": "http_param",
33
+ "severity": "high",
34
+ "return_tainted": true,
35
+ "framework": "actix-web"
36
+ },
37
+ {
38
+ "method": "into_inner",
39
+ "class": "Json",
40
+ "type": "http_body",
41
+ "severity": "high",
42
+ "return_tainted": true,
43
+ "framework": "actix-web"
44
+ },
45
+ {
46
+ "method": "into_inner",
47
+ "class": "Form",
48
+ "type": "http_param",
49
+ "severity": "high",
50
+ "return_tainted": true,
51
+ "framework": "actix-web"
52
+ },
53
+ {
54
+ "method": "match_info",
55
+ "class": "HttpRequest",
56
+ "type": "http_param",
57
+ "severity": "high",
58
+ "return_tainted": true,
59
+ "framework": "actix-web"
60
+ },
61
+ {
62
+ "method": "headers",
63
+ "class": "HttpRequest",
64
+ "type": "http_header",
65
+ "severity": "high",
66
+ "return_tainted": true,
67
+ "framework": "actix-web"
68
+ },
69
+ {
70
+ "method": "cookie",
71
+ "class": "HttpRequest",
72
+ "type": "http_cookie",
73
+ "severity": "high",
74
+ "return_tainted": true,
75
+ "framework": "actix-web"
76
+ },
77
+ {
78
+ "method": "param",
79
+ "class": "Request",
80
+ "type": "http_param",
81
+ "severity": "high",
82
+ "return_tainted": true,
83
+ "framework": "rocket"
84
+ },
85
+ {
86
+ "method": "into_inner",
87
+ "class": "Form",
88
+ "type": "http_param",
89
+ "severity": "high",
90
+ "return_tainted": true,
91
+ "framework": "rocket"
92
+ },
93
+ {
94
+ "method": "into_inner",
95
+ "class": "Json",
96
+ "type": "http_body",
97
+ "severity": "high",
98
+ "return_tainted": true,
99
+ "framework": "rocket"
100
+ },
101
+ {
102
+ "method": "cookies",
103
+ "class": "Request",
104
+ "type": "http_cookie",
105
+ "severity": "high",
106
+ "return_tainted": true,
107
+ "framework": "rocket"
108
+ },
109
+ {
110
+ "method": "headers",
111
+ "class": "Request",
112
+ "type": "http_header",
113
+ "severity": "high",
114
+ "return_tainted": true,
115
+ "framework": "rocket"
116
+ },
117
+ {
118
+ "method": "body",
119
+ "class": "Request",
120
+ "type": "http_body",
121
+ "severity": "high",
122
+ "return_tainted": true,
123
+ "framework": "axum"
124
+ },
125
+ {
126
+ "method": "extract",
127
+ "class": "Query",
128
+ "type": "http_param",
129
+ "severity": "high",
130
+ "return_tainted": true,
131
+ "framework": "axum"
132
+ },
133
+ {
134
+ "method": "extract",
135
+ "class": "Path",
136
+ "type": "http_param",
137
+ "severity": "high",
138
+ "return_tainted": true,
139
+ "framework": "axum"
140
+ },
141
+ {
142
+ "method": "extract",
143
+ "class": "Json",
144
+ "type": "http_body",
145
+ "severity": "high",
146
+ "return_tainted": true,
147
+ "framework": "axum"
148
+ },
149
+ {
150
+ "method": "var",
151
+ "class": "env",
152
+ "type": "env_var",
153
+ "severity": "medium",
154
+ "return_tainted": true,
155
+ "framework": "std"
156
+ },
157
+ {
158
+ "method": "var_os",
159
+ "class": "env",
160
+ "type": "env_var",
161
+ "severity": "medium",
162
+ "return_tainted": true,
163
+ "framework": "std"
164
+ },
165
+ {
166
+ "method": "args",
167
+ "class": "env",
168
+ "type": "cli_arg",
169
+ "severity": "medium",
170
+ "return_tainted": true,
171
+ "framework": "std"
172
+ },
173
+ {
174
+ "method": "args_os",
175
+ "class": "env",
176
+ "type": "cli_arg",
177
+ "severity": "medium",
178
+ "return_tainted": true,
179
+ "framework": "std"
180
+ },
181
+ {
182
+ "method": "read_to_string",
183
+ "class": "File",
184
+ "type": "file_read",
185
+ "severity": "medium",
186
+ "return_tainted": true,
187
+ "framework": "std"
188
+ },
189
+ {
190
+ "method": "read",
191
+ "class": "File",
192
+ "type": "file_read",
193
+ "severity": "medium",
194
+ "return_tainted": true,
195
+ "framework": "std"
196
+ },
197
+ {
198
+ "method": "read_to_end",
199
+ "class": "File",
200
+ "type": "file_read",
201
+ "severity": "medium",
202
+ "return_tainted": true,
203
+ "framework": "std"
204
+ },
205
+ {
206
+ "method": "read_line",
207
+ "class": "BufReader",
208
+ "type": "file_read",
209
+ "severity": "medium",
210
+ "return_tainted": true,
211
+ "framework": "std"
212
+ },
213
+ {
214
+ "method": "lines",
215
+ "class": "BufReader",
216
+ "type": "file_read",
217
+ "severity": "medium",
218
+ "return_tainted": true,
219
+ "framework": "std"
220
+ },
221
+ {
222
+ "method": "read_to_string",
223
+ "class": "stdin",
224
+ "type": "stdin",
225
+ "severity": "medium",
226
+ "return_tainted": true,
227
+ "framework": "std"
228
+ },
229
+ {
230
+ "method": "read_line",
231
+ "class": "stdin",
232
+ "type": "stdin",
233
+ "severity": "medium",
234
+ "return_tainted": true,
235
+ "framework": "std"
236
+ },
237
+ {
238
+ "method": "recv",
239
+ "class": "TcpStream",
240
+ "type": "network",
241
+ "severity": "high",
242
+ "return_tainted": true,
243
+ "framework": "std"
244
+ },
245
+ {
246
+ "method": "read",
247
+ "class": "TcpStream",
248
+ "type": "network",
249
+ "severity": "high",
250
+ "return_tainted": true,
251
+ "framework": "std"
252
+ },
253
+ {
254
+ "method": "recv",
255
+ "class": "UdpSocket",
256
+ "type": "network",
257
+ "severity": "high",
258
+ "return_tainted": true,
259
+ "framework": "std"
260
+ },
261
+ {
262
+ "method": "query",
263
+ "class": "Client",
264
+ "type": "db_result",
265
+ "severity": "medium",
266
+ "return_tainted": true,
267
+ "framework": "sqlx"
268
+ },
269
+ {
270
+ "method": "fetch_one",
271
+ "class": "Client",
272
+ "type": "db_result",
273
+ "severity": "medium",
274
+ "return_tainted": true,
275
+ "framework": "sqlx"
276
+ },
277
+ {
278
+ "method": "fetch_all",
279
+ "class": "Client",
280
+ "type": "db_result",
281
+ "severity": "medium",
282
+ "return_tainted": true,
283
+ "framework": "sqlx"
284
+ }
285
+ ]
286
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "sources": [
3
+ {
4
+ "annotation": "@RequestBody",
5
+ "type": "http_body",
6
+ "severity": "high",
7
+ "cwe": null
8
+ },
9
+ {
10
+ "annotation": "@RequestParam",
11
+ "type": "http_param",
12
+ "severity": "high",
13
+ "cwe": null
14
+ },
15
+ {
16
+ "annotation": "@PathVariable",
17
+ "type": "http_path",
18
+ "severity": "medium",
19
+ "cwe": null
20
+ },
21
+ {
22
+ "annotation": "@RequestHeader",
23
+ "type": "http_header",
24
+ "severity": "medium",
25
+ "cwe": null
26
+ },
27
+ {
28
+ "annotation": "@CookieValue",
29
+ "type": "http_cookie",
30
+ "severity": "high",
31
+ "cwe": null
32
+ },
33
+ {
34
+ "annotation": "@MatrixVariable",
35
+ "type": "http_matrix",
36
+ "severity": "medium",
37
+ "cwe": null
38
+ },
39
+ {
40
+ "method": "getParameter",
41
+ "class": "HttpServletRequest",
42
+ "type": "http_param",
43
+ "severity": "high"
44
+ },
45
+ {
46
+ "method": "getInputStream",
47
+ "class": "HttpServletRequest",
48
+ "type": "http_body",
49
+ "severity": "high"
50
+ },
51
+ {
52
+ "method": "getReader",
53
+ "class": "HttpServletRequest",
54
+ "type": "http_body",
55
+ "severity": "high"
56
+ },
57
+ {
58
+ "method": "getHeader",
59
+ "class": "HttpServletRequest",
60
+ "type": "http_header",
61
+ "severity": "medium"
62
+ },
63
+ {
64
+ "method": "getCookies",
65
+ "class": "HttpServletRequest",
66
+ "type": "http_cookie",
67
+ "severity": "high"
68
+ }
69
+ ]
70
+ }
@@ -0,0 +1,86 @@
1
+ /**
2
+ * RustSec Advisory Database Integration
3
+ *
4
+ * Provides vulnerability data from the RustSec advisory database.
5
+ * Advisory data is bundled at build time for offline/deterministic usage.
6
+ */
7
+ import type { Severity } from '../types/index.js';
8
+ export interface AdvisoryVulnerability {
9
+ /** Unique advisory ID (RUSTSEC-YYYY-NNNN) */
10
+ id: string;
11
+ /** Crate name */
12
+ package: string;
13
+ /** Advisory date (RFC 3339) */
14
+ date: string;
15
+ /** Advisory URL */
16
+ url: string;
17
+ /** CVSS score string */
18
+ cvss?: string;
19
+ /** Vulnerability categories */
20
+ categories: string[];
21
+ /** Search keywords */
22
+ keywords: string[];
23
+ /** Related identifiers (CVE, etc.) */
24
+ aliases: string[];
25
+ /** Affected functions with version constraints */
26
+ affectedFunctions?: {
27
+ name: string;
28
+ versions: string[];
29
+ }[];
30
+ /** Version constraints */
31
+ versions: {
32
+ patched?: string[];
33
+ unaffected?: string[];
34
+ };
35
+ /** Affected architectures */
36
+ affectedArch?: string[];
37
+ /** Affected operating systems */
38
+ affectedOs?: string[];
39
+ /** Human-readable description */
40
+ description: string;
41
+ /** Title/summary of the vulnerability */
42
+ title?: string;
43
+ }
44
+ export interface AdvisoryDatabase {
45
+ /** Map of crate name to list of advisories */
46
+ advisories: Map<string, AdvisoryVulnerability[]>;
47
+ /** When the database was last updated */
48
+ lastUpdated: string;
49
+ /** Source of the database */
50
+ source: 'bundled' | 'fetched';
51
+ /** Database format version */
52
+ version: string;
53
+ /** Statistics */
54
+ stats?: {
55
+ totalAdvisories: number;
56
+ uniqueCrates: number;
57
+ };
58
+ }
59
+ /**
60
+ * Load the bundled advisory database
61
+ */
62
+ export declare function loadBundledAdvisories(): AdvisoryDatabase;
63
+ /**
64
+ * Parse advisory JSON into database structure
65
+ */
66
+ export declare function parseAdvisoryJson(json: {
67
+ version: string;
68
+ lastUpdated: string;
69
+ advisories: AdvisoryVulnerability[];
70
+ }): AdvisoryDatabase;
71
+ /**
72
+ * Map RustSec categories to severity levels
73
+ */
74
+ export declare function categoryToSeverity(categories: string[]): Severity;
75
+ /**
76
+ * Get advisories for a specific crate
77
+ */
78
+ export declare function getAdvisoriesForCrate(db: AdvisoryDatabase, crateName: string): AdvisoryVulnerability[];
79
+ /**
80
+ * Search advisories by CVE ID
81
+ */
82
+ export declare function findAdvisoryByCve(db: AdvisoryDatabase, cveId: string): AdvisoryVulnerability | undefined;
83
+ /**
84
+ * Get all unique crate names with advisories
85
+ */
86
+ export declare function getVulnerableCrates(db: AdvisoryDatabase): string[];