mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Update zipslip_bad.py
This commit is contained in:
@@ -2,8 +2,8 @@ import zipfile
|
||||
import shutil
|
||||
|
||||
def unzip(filename):
|
||||
zf = zipfile.ZipFile()
|
||||
with zf.open(filename) as zipf:
|
||||
|
||||
with zipfile.ZipFile(filename) as zipf:
|
||||
#BAD : This could write any file on the filesystem.
|
||||
for entry in zipf:
|
||||
shutil.copyfileobj(entry, "/tmp/unpack/")
|
||||
for entry in zipf:
|
||||
shutil.copy(entry, "/tmp/unpack/")
|
||||
|
||||
Reference in New Issue
Block a user