Bug 1192603 (CVE-2015-1315)

Summary: CVE-2015-1315 unzip: charset_to_intern() buffer overflow
Product: [Other] Security Response Reporter: Tomas Hoger <thoger>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: carnil, security-response-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-13 20:31:50 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:    
Bug Blocks: 1192604    
Attachments:
Description Flags
Vulnerable function
none
Ubuntu patch
none
Fixed version of 06-unzip60-alt-iconv-utf8 none

Description Tomas Hoger 2015-02-13 20:08:35 UTC
William Robinet reports:

"""
Info-ZIP "UnZip" is an extraction utility for archives compressed in ".zip"
format.

Out-of-bounds write can be triggered with a malformed zip file resulting in a
crash or arbitrary code execution.

The problem lies in the "unix/unix.c:charset_to_intern()" function which is
part of the 06-unzip60-alt-iconv-utf8 patch (Ubuntu reference [0]).

It can be triggered during string conversion from CP866 to UTF-8 for which the
destination buffer is not large enough.

[0] Ubuntu iconv patch:
    http://archive.ubuntu.com/ubuntu/pool/main/u/unzip/unzip_6.0-9ubuntu1.2.debian.tar.gz
    file debian/patches/06-unzip60-alt-iconv-utf8
"""

Acknowledgment:

Red Hat would like to thank William Robinet for reporting this issue.

Comment 1 Tomas Hoger 2015-02-13 20:12:05 UTC
Created attachment 991545 [details]
Vulnerable function

Part of the 06-unzip60-alt-iconv-utf8 patch which contains the vulnerable function.

Comment 4 Tomas Hoger 2015-02-13 20:31:50 UTC
This issue does not affect any released upstream version.  Affected code does not exist in the latest upstream version - 6.0.  It is introduced as part of a patch that adds support for file names using non-latin and non-unicode encoding, which is used in unzip packages in certain Linux or BSD distributions.  The patch has been proposed for inclusion in Red Hat Enterprise Linux unzip packages - see bug 885540 comment 2 - but has not been applied there or in Fedora to date.  Therefore, Red Hat Enterprise Linux and Fedora unzip packages are not affected by this issue.

It should be noted that the code seems to have been accepted upstream, as it appears in the 6.1 development/beta code.

Statement:

Not vulnerable. This issue did not affect the version of unzip as shipped in Red Hat Enterprise Linux 5, 6, and 7.

Comment 5 Tomas Hoger 2015-02-16 07:36:04 UTC
Created attachment 992062 [details]
Ubuntu patch

Comment 6 Tomas Hoger 2015-02-16 07:38:07 UTC
Created attachment 992063 [details]
Fixed version of 06-unzip60-alt-iconv-utf8

Full iconv patch with the above fix applied.  It obsoletes the patch in bug 885540 comment 2.