Skip to content

Exception while extracting file from ZIP with non-matching file name in central directory #75358

Description

@zyxtarmo
mannequin
BPO 31175
Nosy @zyxtarmo
PRs
  • Allow filename mismatch in local and central directories in zipfile.py #3035
  • Files
  • ZIP_filename_confusion.pdf: Small research paper on the topic
  • zipfile.patch
  • 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:

    assignee = None
    closed_at = None
    created_at = <Date 2017-08-10.13:05:08.569>
    labels = ['type-bug', 'library']
    title = 'Exception while extracting file from ZIP with non-matching file name in central directory'
    updated_at = <Date 2017-08-10.13:08:08.683>
    user = 'https://github.com/zyxtarmo'

    bugs.python.org fields:

    activity = <Date 2017-08-10.13:08:08.683>
    actor = 'zyxtarmo'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2017-08-10.13:05:08.569>
    creator = 'zyxtarmo'
    dependencies = []
    files = ['47073', '47074']
    hgrepos = []
    issue_num = 31175
    keywords = ['patch']
    message_count = 2.0
    messages = ['300080', '300081']
    nosy_count = 1.0
    nosy_names = ['zyxtarmo']
    pr_nums = ['3035']
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue31175'
    versions = ['Python 2.7']

    Activity

    1. zyxtarmo commented on Aug 10, 2017

      zyxtarmomannequin
      MannequinAuthor

      The problem: miscreants are modifying ZIP file header parts so, that Python based automated analysis tools are unable to process the contents of the ZIP file but intended clients are able to open the file and extract the possibly malicious contents.

      Github pull request contains patch addressing the issue so that developer can make conscious decision to allow extraction process to complete. Quite important feature for security researchers.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Aug 10, 2017
    3. zyxtarmo commented on Aug 10, 2017

      zyxtarmomannequin
      MannequinAuthor

      Proposed patch

    4. transferred this issue fromon Apr 10, 2022
    5. serhiy-storchaka commented on May 18, 2026

      @serhiy-storchaka
      Member

      This is a duplicate of #51088.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions