Update zipslip_bad.py

This commit is contained in:
Ahmed Farid
2022-03-07 00:24:25 +01:00
committed by GitHub
parent 6233309028
commit 0d9436892a

View File

@@ -2,15 +2,12 @@ import zipfile
import shutil
def unzip(filename):
with zipfile.ZipFile(filename) as zipf:
#BAD : This could write any file on the filesystem.
for entry in zipf:
shutil.copy(entry, "/tmp/unpack/")
def unzip1(filename):
with zipfile.ZipFile(filename) as zipf:
for entry in zipf:
with open(entry, 'wb') as dstfile: