Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b9b52d4

Browse files
Update zipslip_bad.py
1 parent d7dacfc commit b9b52d4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import zipfile
22
import shutil
33

4+
def unzip(filename):
45

5-
zf = zipfile.ZipFile(filename)
6-
with zf.open() as zipf:
6+
with zipfile.ZipFile(filename) as zipf:
77
#BAD : This could write any file on the filesystem.
8-
for entry in zipf:
9-
shutil.copy(entry, "/tmp/unpack/")
8+
for entry in zipf:
9+
shutil.copy(entry, "/tmp/unpack/")

0 commit comments

Comments
 (0)