Bug 1305536 (CVE-2016-4342)

Summary: CVE-2016-4342 php: use of uninitialized pointer in PharFileInfo::getContent
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: abhgupta, dmcphers, fedora, hkim, jialiu, jokerman, jorton, kseifried, lmeyer, mmaslano, mmccomas, rcollet, tiwillia, webstack-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: php 5.6.18, php 5.5.32 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-12 12:38:49 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: 1305565    
Bug Blocks: 1305564    

Description Adam Mariš 2016-02-08 14:29:33 UTC
A heap corruption vulnerability when parsing tar/zip/phar file with empty content.

Upstream bug:

https://bugs.php.net/bug.php?id=71354

Upstream patch:

https://git.php.net/?p=php-src.git;a=commitdiff;h=13ad4d3e971807f9a58ab5933182907dc2958539

Comment 1 Adam Mariš 2016-02-08 15:13:15 UTC
Created php tracking bugs for this issue:

Affects: fedora-all [bug 1305565]

Comment 2 Andrej Nemec 2016-05-02 14:31:16 UTC
CVE assignment:

http://seclists.org/oss-sec/2016/q2/163

Comment 4 Tomas Hoger 2016-10-12 12:38:49 UTC
This issue is triggered by a specially-crafted Tar format Phar files.  Phar files are distribution format for PHP applications (similar to Java Jar format) and their content is typically executed on the server.  Malicious Phar archive can therefore execute code on the system without exploiting any parsing issues.

If Phar extension is not used, it can be disabled by commenting out the following line:

  extension=phar.so

in /etc/php.d/phar.ini to prevent loading of the extension.

Comment 5 errata-xmlrpc 2016-11-15 11:49:21 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS

Via RHSA-2016:2750 https://rhn.redhat.com/errata/RHSA-2016-2750.html