Skip to content

Zip slip vulnerability #7985

Closed
Closed

Description

Hi there

LGTM discovered a potential occurrence of the Zip Slip vulnerability. The alert is available here

For more details about this vulnerability : https://lgtm.com/rules/1506511188430/
Best regards

Activity

  1. iSazonov commented on Oct 11, 2018

    @iSazonov
    Collaborator

    I don't see a problem - we use recommended Path.Combine(destination, entry.FullName);

  2. added
    WG-Engine
    Compliance
    on Oct 11, 2018
  3. xcorail commented on Oct 11, 2018

    @xcorail
    Author

    Hi Ilya (@iSazonov)

    The recommended way of writing an output file from a zip archive entry is to:
    
    1. Use Path.Combine(destinationDirectory, archiveEntry.FullName) to determine the raw output path.
    2. Use Path.GetFullPath(..) on the raw output path to resolve any directory traversal elements.
    3. Use Path.GetFullPath(destinationDirectory + Path.DirectorySeparatorChar) to determine the fully resolved path of the destination directory.
    4. Validate that the resolved output path StartsWith the resolved destination directory, aborting if this is not true.
    

    The recommendation is to do 1, 2, 3 and 4, not only 1. Path.Combine does not perform any sanitization of the entry full path

    Cheers

  4. iSazonov commented on Oct 11, 2018

    @iSazonov
    Collaborator
  5. TravisEz13 commented on Nov 14, 2018

    @TravisEz13
    Member

    Fixed in #8252

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

Metadata

Metadata

Labels

ComplianceResolution-FixedWG-Engine

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions