python / cpython

The Python programming language
https://www.python.org/
Other
61.22k stars 29.53k forks source link

Allow filename mismatch in local and central directories in zipfile.py #83509

Open csabella opened 4 years ago

csabella commented 4 years ago
BPO 39328
Nosy @gpshead, @csabella

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields: ```python assignee = None closed_at = None created_at = labels = ['type-feature', '3.9'] title = 'Allow filename mismatch in local and central directories in zipfile.py' updated_at = user = 'https://github.com/csabella' ``` bugs.python.org fields: ```python activity = actor = 'cheryl.sabella' assignee = 'none' closed = False closed_date = None closer = None components = [] creation = creator = 'cheryl.sabella' dependencies = [] files = [] hgrepos = [] issue_num = 39328 keywords = [] message_count = 1.0 messages = ['359966'] nosy_count = 2.0 nosy_names = ['gregory.p.smith', 'cheryl.sabella'] pr_nums = [] priority = 'normal' resolution = None stage = 'needs patch' status = 'open' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue39328' versions = ['Python 3.9'] ```

csabella commented 4 years ago

This is being opened from the report on GH3035.

During malware research I bumped int problem with my Python based file analyzer: miscreants are modifying ZIP file header parts so, that python based automated analysis tools are unable to process the contents but intended clients are able to open the files with end-user applications and extract the possibly malicious contents. Proposed patch makes it possible to process the ZIP files even if such conditions occur. Default behavior remains the same (raise BadZipFile exception).