Bug 1174856 (CVE-2014-8141)

Summary: CVE-2014-8141 unzip: getZip64Data() out-of-bounds read issues (oCERT-2014-011)
Product: [Other] Security Response Reporter: Tomas Hoger <thoger>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact: Frantisek Sumsal <fsumsal>
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: carnil, dmoessne, fsumsal, jaeshin, pstodulk, raysatiro, security-response-team, vkaigoro
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
A buffer overflow flaw was found in the way unzip handled Zip64 files. A specially crafted Zip archive could possibly cause unzip to crash when the archive was uncompressed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-18 21:11:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1191118, 1196128, 1196129, 1196130, 1196131    
Bug Blocks: 1174865    
Attachments:
Description Flags
Upstream patch
none
upstream patch none

Description Tomas Hoger 2014-12-16 15:46:35 UTC
oCERT reports an unzip flaw discovered by Michele Spagnuolo, Google Security Team:

"""
The read errors show problems in process.c:getZip64Data(), which lacked any error detection or reporting, and was trying to extract multi-byte data from a buffer which did not contain enough bytes.

Proposed changes:

http://antinode.info/ftp/info-zip/unzip60/fileio.c
fileio.c:do_string() looks at the status value returned from process.c:getZip64Data(), and puts out a new warning.
    
http://antinode.info/ftp/info-zip/unzip60/process.c
process.c:getZip64Data() gets new validity tests, and it returns a useful status value.
"""

Acknowledgement:

Red Hat would like to thank oCERT for reporting these issues. oCERT acknowledges Michele Spagnuolo of the Google Security Team as the original reporter.

Comment 2 Tomas Hoger 2014-12-16 15:57:05 UTC
Created attachment 969625 [details]
Upstream patch

Created using the instructions from the original report as quoted in comment 0.

Comment 6 Huzaifa S. Sidhpurwala 2014-12-22 15:49:59 UTC
External Reference:

http://www.ocert.org/advisories/ocert-2014-011.html

Comment 10 Tomas Hoger 2015-02-09 20:20:45 UTC
This issue only affects UnZip version 6.0, which is the version that introduced Zip64 support.  Older versions, such as unzip 5.52 as shipped with Red Hat Enterprise Linux 5, do not contain affected code.

This is a heap-base buffer over-read issue.  Over-read is limited to 28 bytes, hence it's unlikely to lead to crash for normal builds.

Comment 11 Petr Stodulka 2015-02-10 09:28:04 UTC
Created attachment 990005 [details]
upstream patch

This is upstream patch which is part of last devel version. There are aesthetic (more readable) changes.

Comment 12 Tomas Hoger 2015-02-10 13:20:26 UTC
This issue can be triggered in both test (unzip -t) and extraction mode.

Comment 13 Tomas Hoger 2015-02-10 13:37:23 UTC
Created unzip tracking bugs for this issue:

Affects: fedora-all [bug 1191118]

Comment 14 Petr Stodulka 2015-02-10 15:47:28 UTC
Comment on attachment 990005 [details]
upstream patch

I apologize, that was for  bug #1174844.

Comment 15 Fedora Update System 2015-02-16 03:25:48 UTC
unzip-6.0-20.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2015-02-23 23:25:21 UTC
unzip-6.0-17.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 19 Vasyl Kaigorodov 2015-03-12 15:00:07 UTC
Statement:

This issue did not affect the versions of unzip as shipped with Red Hat Enterprise Linux 5 as they did not include support for Zip64.

Comment 20 errata-xmlrpc 2015-03-18 18:59:16 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6
  Red Hat Enterprise Linux 7

Via RHSA-2015:0700 https://rhn.redhat.com/errata/RHSA-2015-0700.html