Commit c5382da
FTMahringer
fix(security): break SSRF taint flow in PluginLoaderService
CodeQL alert #10 (java/ssrf) flagged URLClassLoader construction as
SSRF-prone because the JAR URL was derived from a Path parameter.
Previous attempts added validation (normalize, isAbsolute, startsWith,
toRealPath) but CodeQL's taint analysis does not recognize these as
sanitizers.
Fix: change loadPlugin(Path, Plugin) -> loadPlugin(Plugin). The JAR
path is now resolved internally from trusted storage directories
(system/ and staging/) using only the plugin ID from the database.
This completely breaks the taint flow because the URL passed to
URLClassLoader is never derived from external/user input.
- PluginLoaderService: removed jarPath parameter, resolve internally
- PluginLoaderController: removed resolveJarPath(), pass dbPlugin only
- PluginUpdateService: updated caller to pass dbPlugin only
- StartupPluginScanner: updated caller to pass dbPlugin only1 parent 5edffca commit c5382da
4 files changed
Lines changed: 32 additions & 76 deletions
File tree
- packages/core/src/main/java/dev/synapse/plugins/loader
Lines changed: 2 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
94 | | - | |
95 | | - | |
| 93 | + | |
96 | 94 | | |
97 | 95 | | |
98 | 96 | | |
| |||
110 | 108 | | |
111 | 109 | | |
112 | 110 | | |
113 | | - | |
114 | 111 | | |
115 | 112 | | |
116 | 113 | | |
117 | | - | |
| 114 | + | |
118 | 115 | | |
119 | 116 | | |
120 | 117 | | |
| |||
233 | 230 | | |
234 | 231 | | |
235 | 232 | | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | 233 | | |
265 | 234 | | |
266 | 235 | | |
| |||
Lines changed: 27 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
76 | | - | |
77 | | - | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | | - | |
89 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 100 | + | |
| 101 | + | |
111 | 102 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
118 | 108 | | |
119 | 109 | | |
120 | | - | |
121 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
122 | 113 | | |
123 | 114 | | |
124 | 115 | | |
125 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
126 | 119 | | |
127 | 120 | | |
128 | | - | |
| 121 | + | |
129 | 122 | | |
130 | 123 | | |
131 | 124 | | |
| |||
215 | 208 | | |
216 | 209 | | |
217 | 210 | | |
218 | | - | |
| 211 | + | |
219 | 212 | | |
220 | 213 | | |
221 | 214 | | |
| |||
254 | 247 | | |
255 | 248 | | |
256 | 249 | | |
257 | | - | |
| 250 | + | |
258 | 251 | | |
259 | 252 | | |
260 | 253 | | |
| |||
275 | 268 | | |
276 | 269 | | |
277 | 270 | | |
278 | | - | |
| 271 | + | |
279 | 272 | | |
280 | 273 | | |
281 | 274 | | |
| |||
350 | 343 | | |
351 | 344 | | |
352 | 345 | | |
353 | | - | |
| 346 | + | |
354 | 347 | | |
355 | 348 | | |
356 | | - | |
| 349 | + | |
357 | 350 | | |
358 | 351 | | |
359 | 352 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 125 | + | |
| 126 | + | |
130 | 127 | | |
131 | 128 | | |
132 | 129 | | |
| |||
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 126 | + | |
130 | 127 | | |
131 | 128 | | |
132 | 129 | | |
| |||
0 commit comments