We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab81247 commit 3d14c5fCopy full SHA for 3d14c5f
python/ql/test/experimental/query-tests/Security/CWE-022/zipslip_bad.py
@@ -1,6 +1,6 @@
1
import tarfile
2
import shutil
3
-import bz2
+import bz2
4
import gzip
5
import zipfile
6
@@ -23,7 +23,7 @@ def unzip2(filename):
23
shutil.copyfile(entry, "/tmp/unpack/")
24
25
def unzip3(filename):
26
- zf = zipfile.ZipFile(filename)
+ zf = zipfile.ZipFile(filename)
27
with zf.namelist() as filelist:
28
#BAD : This could write any file on the filesystem.
29
for x in filelist:
@@ -36,3 +36,4 @@ def unzip4(filename):
36
with zf.open(x) as srcf:
37
shutil.copyfileobj(x, "/tmp/unpack/")
38
39
+import tty # to set the import root so we can identify the standard library
0 commit comments