[issue36988] zipfile: string IndexError on extract

2022-01-16 Thread Irit Katriel


Irit Katriel  added the comment:

Reproduced on 3.11.

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python 
3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36988] zipfile: string IndexError on extract

2019-05-31 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


--
nosy:  -Jeffrey.Kintscher

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36988] zipfile: string IndexError on extract

2019-05-28 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


--
nosy: +Jeffrey.Kintscher

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36988] zipfile: string IndexError on extract

2019-05-21 Thread KunYu Chen


KunYu Chen  added the comment:

Hi alter-bug-tracer,

We notice about this pitfall when extracting zipbomb files.
and we have discussion here

https://bugs.python.org/issue36260

--
nosy: +18z

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36988] zipfile: string IndexError on extract

2019-05-21 Thread alter-bug-tracer


alter-bug-tracer  added the comment:

Hi,

The zip is corrupted on purpose.
I agree, every input should be checked before doing stuff with it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36988] zipfile: string IndexError on extract

2019-05-21 Thread JUN-WEI SONG


JUN-WEI SONG  added the comment:

The following output throws error when using unzip -t 

$ unzip -t file0.zip

Output:

Archive:  file0.zip
:  mismatching "local" filename (zipfile_extract.pyUT^I),
 continuing with "central" filename version
testing: 
  error:  invalid compressed data to inflate
At least one error was detected in file0.zip.

It looks like the zip file is corrupted. Maybe we could add some detection 
mechanisms before extract it like unzip, for example, unsupported characters or 
file corrupted check.

--
nosy: +krnick

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36988] zipfile: string IndexError on extract

2019-05-21 Thread alter-bug-tracer


New submission from alter-bug-tracer :

The following code throws an IndexError when attempting to extract a malformed 
archive (attached):

import zipfile
import sys

zf = zipfile.ZipFile(sys.argv[1])
for info in zf.infolist():
  zf.extract(info.filename)

Result:
Traceback (most recent call last):
  File "code.py", line 6, in 
zf.extract(info.filename)
  File "/usr/lib/python3.6/zipfile.py", line 1507, in extract
return self._extract_member(member, path, pwd)
  File "/usr/lib/python3.6/zipfile.py", line 1572, in _extract_member
if member.is_dir():
  File "/usr/lib/python3.6/zipfile.py", line 531, in is_dir
return self.filename[-1] == '/'
IndexError: string index out of range

--
files: file0.zip
messages: 343006
nosy: alter-bug-tracer
priority: normal
severity: normal
status: open
title: zipfile: string IndexError on extract
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file48345/file0.zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com