You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Herve Boutemy (Jira)" <ji...@apache.org> on 2021/12/05 14:37:00 UTC

[jira] (MWRAPPER-21) Arbitrary file write during archive extraction ("Zip Slip") in wrapper

    [ https://issues.apache.org/jira/browse/MWRAPPER-21 ]


    Herve Boutemy deleted comment on MWRAPPER-21:
    ---------------------------------------

was (Author: hudson):
Build succeeded in Jenkins: Maven » Maven TLP » maven » MNG-6169/MNG-6556 #14

See https://ci-builds.apache.org/job/Maven/job/maven-box/job/maven/job/MNG-6169%252FMNG-6556/14/

> Arbitrary file write during archive extraction ("Zip Slip") in wrapper
> ----------------------------------------------------------------------
>
>                 Key: MWRAPPER-21
>                 URL: https://issues.apache.org/jira/browse/MWRAPPER-21
>             Project: Maven Wrapper
>          Issue Type: Bug
>    Affects Versions: 0.5.6
>            Reporter: Sylwester Lachiewicz
>            Assignee: Robert Scholte
>            Priority: Major
>             Fix For: 3.1.0
>
>
> In Maven Wrapper Installer [https://github.com/apache/maven/blob/ef8c95eb397651e10f677763dfcd9c8cea7c27b0/maven-wrapper/src/main/java/org/apache/maven/wrapper/Installer.java]
>   
> {code:java}
>  ZipEntry entry = entries.nextElement();
>  if ( entry.isDirectory() )
>  {
>   continue;
>  }
>  Path targetFile = dest.resolve( entry.getName() );
> // Unsanitized archive entry, which may contain '..', is used in a file system operation.
>   // prevent Zip Slip
> if ( targetFile.startsWith( dest ) ) 
> {
>    Files.createDirectories( targetFile.getParent() );
>    Files.copy( zipFile.getInputStream( entry ), targetFile );
> }
> {code}
>  
>  Found via LGTM.com scan



--
This message was sent by Atlassian Jira
(v8.20.1#820001)