Bug 1584407 - ant: arbitrary file write vulnerability and arbitrary code execution using a specially crafted zip file
Summary: ant: arbitrary file write vulnerability and arbitrary code execution using a ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1585543 1585544 1588276 1588277
Blocks: 1584408
TreeView+ depends on / blocked
 
Reported: 2018-05-30 20:08 UTC by Laura Pardo
Modified: 2021-02-17 00:13 UTC (History)
25 users (show)

Fixed In Version: ant 1.9.12
Doc Type: If docs needed, set a value
Doc Text:
It was discovered that Ant's unzip and untar targets permit the extraction of files outside the target directory. A crafted zip or tar file submitted to an Ant build could create or overwrite arbitrary files with the privileges of the user running Ant.
Clone Of:
Environment:
Last Closed: 2018-08-06 03:47:25 UTC
Embargoed:


Attachments (Terms of Use)

Description Laura Pardo 2018-05-30 20:08:48 UTC
A vulnerability has been found in the way developers have implemented the archive extraction of files. An arbitrary file write vulnerability, that can be achieved using a specially crafted zip archive (affects other archives as well, bzip2, tar,xz, war, cpio, 7z), that holds path traversal filenames. So when the filename gets concatenated to the target extraction directory, the final path ends up outside of the target folder. Of course if an executable or a configuration file is overwritten with a file containing malicious code, the problem can turn into an arbitrary code execution issue quite easily. This affects multiple libraries that lacks of a high level APIs that provide the archive extraction functionality.

Comment 1 Tomas Hoger 2018-05-31 07:03:26 UTC
According to the reporter, this was fixed upstream in version 1.9.12.

Comment 3 Kurt Seifried 2018-06-01 16:56:29 UTC
Statement:

This issue affects the versions of the nutch package as shipped with Red Hat Satellite 5. However, this flaw is not known to be exploitable under any supported scenario in Satellite 5. A future update may address this issue.

Comment 6 Doran Moppert 2018-06-04 03:37:18 UTC
Acknowledgments:

Name: Danny Grander (Snyk)

Comment 7 Doran Moppert 2018-06-07 02:44:41 UTC
Created ant tracking bugs for this issue:

Affects: fedora-all [bug 1588277]

Comment 9 Fedora Update System 2018-07-03 16:51:43 UTC
ant-1.10.1-10.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Doran Moppert 2018-07-04 03:29:38 UTC
External References:

https://snyk.io/research/zip-slip-vulnerability

Comment 12 Fedora Update System 2018-07-05 15:17:50 UTC
ant-1.10.1-10.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Salvatore Bonaccorso 2018-07-21 11:02:24 UTC
The fixes as released in 1.10.4 and 1.9.12 were incomplete, there was a respective followup with

https://github.com/apache/ant/commit/6a41d62cb9ab4e640b72cb4de42a6c211dea645d
https://github.com/apache/ant/commit/5a8c37b271677587046bfd0fea18c1675d5a6300

I requested a CVE for the incomplete fix to CVE-2018-10886.

Comment 14 Doran Moppert 2018-07-24 03:43:50 UTC
The assignment of CVE-2018-10886 is withdrawn as Apache Ant is not in Red Hat's scope as a CNA.  The Apache project will follow up with MITRE.


Note You need to log in before you can comment on or make changes to this bug.