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

Skip to content

Commit 35a1c80

Browse files
Update zipslip_bad.py
1 parent 0d94368 commit 35a1c80

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

  • python/ql/test/experimental/query-tests/Security/CWE-022

python/ql/test/experimental/query-tests/Security/CWE-022/zipslip_bad.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22
import shutil
33

44
def unzip(filename):
5-
65
with zipfile.ZipFile(filename) as zipf:
76
#BAD : This could write any file on the filesystem.
87
for entry in zipf:
98
shutil.copy(entry, "/tmp/unpack/")
109

1110
def unzip1(filename):
12-
13-
1411
with zipfile.ZipFile(filename) as zipf:
1512
for entry in zipf:
1613
with open(entry, 'wb') as dstfile:

0 commit comments

Comments
 (0)