Commit 0dd2fb1
Fix Zip Slip vulnerability in NGC private bundle download (Project-MONAI#8682)
Replaced the unsafe `zipfile.extractall()` in
`_download_from_ngc_private` with MONAI's safe extraction utility.
Prevents path traversal via crafted zip member paths (CWE-22).
### Description
This changes _download_from_ngc_private() to use the same safe zip
extraction path as the other bundle download sources. The previous code
used ZipFile.extractall() directly, which could allow Zip Slip path
traversal if a malicious archive is downloaded. Now extraction validates
member paths and keeps writes within the target directory.
---------
Signed-off-by: Yue (Knox) Liu <64764840+yueyueL@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>1 parent 9c6d819 commit 0dd2fb1
1 file changed
+3
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | | - | |
| 32 | + | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
288 | 287 | | |
289 | 288 | | |
290 | 289 | | |
291 | | - | |
292 | | - | |
293 | | - | |
| 290 | + | |
| 291 | + | |
294 | 292 | | |
295 | 293 | | |
296 | 294 | | |
| |||
0 commit comments