Repository navigation
Commit 2d14bb4
committed
Fix GHSA-x6pr-233j-x5cw: warn before executing an FL-provisioned bundle config
MonaiAlgo/MonaiAlgoStats run a bundle whose whole app directory is provisioned
by the FL system: initialize() resolves bundle_root against the server-supplied
extra[APP_ROOT], builds a ConfigWorkflow over <app_root>/configs/train.json and
runs its `initialize` expressions. Because FL tasks are dispatched per round and
executed with no human in the loop, a malicious or compromised aggregation
server gets silent code execution on every participating client.
The warning added for GHSA-873f-pvrv-4x83 lives in create_workflow(), which this
path never calls -- MonaiAlgo constructs ConfigWorkflow directly -- so nothing
warned here at all.
Executing the config stays unblocked, for the same reason a trust flag was
dropped from the earlier fix: MONAI cannot establish whether a bundle is
trustworthy, so a flag only teaches operators to set it once and forget it. Both
initialize() methods now raise a UserWarning naming the trust boundary.
Separately closes GHSA-wvpx-5qmp-46g3 on this path. ConfigWorkflow defaults
logging_file to the bundle's own configs/logging.conf and hands it to
logging.config.fileConfig, which eval()s the INI's class=/args= fields -- code
execution at construction time, before any config is parsed, hidden in a plain
INI rather than the MONAI $-DSL. The FL client now defaults
extra[ExtraItems.LOGGING_FILE] to False so a server-written logging.conf is
never applied; an FL system that wants bundle logging passes an explicit path.
ConfigWorkflow and BundleWorkflow warn whenever fileConfig actually runs, so the
warning is raised only when a file is really executed.
Also fixes a "diable" typo in both initialize() docstrings.
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>1 parent fd8a819 commit 2d14bb4
4 files changed
Lines changed: 233 additions & 5 deletions
File tree
- monai
- bundle
- fl/client
- tests
- bundle
- fl/monai_algo
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
37 | 55 | | |
38 | 56 | | |
39 | 57 | | |
| |||
55 | 73 | | |
56 | 74 | | |
57 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
58 | 79 | | |
59 | 80 | | |
60 | 81 | | |
| |||
72 | 93 | | |
73 | 94 | | |
74 | 95 | | |
| 96 | + | |
75 | 97 | | |
76 | 98 | | |
77 | 99 | | |
| |||
273 | 295 | | |
274 | 296 | | |
275 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
276 | 301 | | |
277 | 302 | | |
278 | 303 | | |
| |||
375 | 400 | | |
376 | 401 | | |
377 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
378 | 406 | | |
379 | 407 | | |
380 | 408 | | |
| |||
444 | 472 | | |
445 | 473 | | |
446 | 474 | | |
| 475 | + | |
447 | 476 | | |
448 | 477 | | |
449 | 478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
37 | 58 | | |
38 | 59 | | |
39 | 60 | | |
| |||
86 | 107 | | |
87 | 108 | | |
88 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
89 | 118 | | |
90 | 119 | | |
91 | 120 | | |
| |||
135 | 164 | | |
136 | 165 | | |
137 | 166 | | |
138 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
139 | 172 | | |
140 | 173 | | |
141 | 174 | | |
142 | 175 | | |
143 | 176 | | |
144 | | - | |
| 177 | + | |
145 | 178 | | |
146 | 179 | | |
147 | 180 | | |
148 | 181 | | |
149 | 182 | | |
| 183 | + | |
150 | 184 | | |
151 | 185 | | |
152 | 186 | | |
| |||
313 | 347 | | |
314 | 348 | | |
315 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
316 | 358 | | |
317 | 359 | | |
318 | 360 | | |
| |||
416 | 458 | | |
417 | 459 | | |
418 | 460 | | |
419 | | - | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
420 | 466 | | |
421 | 467 | | |
422 | 468 | | |
423 | 469 | | |
424 | 470 | | |
425 | 471 | | |
426 | | - | |
| 472 | + | |
427 | 473 | | |
428 | 474 | | |
429 | 475 | | |
430 | 476 | | |
431 | 477 | | |
| 478 | + | |
432 | 479 | | |
433 | 480 | | |
434 | 481 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
268 | 270 | | |
269 | 271 | | |
270 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
271 | 328 | | |
272 | 329 | | |
0 commit comments