Bug 823594 (CVE-2012-2386)

Summary: CVE-2012-2386 php: Integer overflow leading to heap-buffer overflow in the Phar extension
Product: [Other] Security Response Reporter: Jan Lieskovsky <jlieskov>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: fedora, jorton, rpm
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: 2012-07-10 17:37:45 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: 830727, 830728, 830729, 830730    
Bug Blocks: 823468, 835959, 835960    

Description Jan Lieskovsky 2012-05-21 15:24:38 UTC
An integer overflow, leading to heap-based buffer overflow was found in the way Phar extension of the PHP scripting language processed certain fields by manipulating TAR files. A remote attacker could provide a specially-crafted TAR archive file, which once processed in an PHP application using the Phar extension could lead to denial of service (application crash), or, potentially arbitary code execution with the privileges of the user running the application.

References:
[1] http://0x1byte.blogspot.com/2011/04/php-phar-extension-heap-overflow.html
[2] http://secunia.com/advisories/44335

Upstream bug (private):
[3] https://bugs.php.net/bug.php?id=61065

CVE Request:
[4] http://www.openwall.com/lists/oss-security/2012/05/20/5

Comment 1 Stefan Cornelius 2012-05-21 16:35:42 UTC
Current upstream patch:
http://git.php.net/?p=php-src.git;a=commitdiff;h=a10e778bfb7ce9caa1f91666ddf2705db7982d68

Comment 5 Stefan Cornelius 2012-05-23 08:38:06 UTC
This is CVE-2012-2386.
http://www.openwall.com/lists/oss-security/2012/05/22/10

Comment 6 Stefan Cornelius 2012-05-29 07:36:26 UTC
Upstream patch for the metadata issue:
http://git.php.net/?p=php-src.git;a=commitdiff;h=158d8a6b088662ce9d31e0c777c6ebe90efdc854

Comment 9 errata-xmlrpc 2012-06-27 15:52:34 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2012:1047 https://rhn.redhat.com/errata/RHSA-2012-1047.html

Comment 10 errata-xmlrpc 2012-06-27 15:53:08 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2012:1046 https://rhn.redhat.com/errata/RHSA-2012-1046.html

Comment 11 Fedora Update System 2012-06-30 22:07:12 UTC
php-5.4.4-1.fc17, maniadrive-1.2-41.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2012-07-02 22:31:34 UTC
php-5.3.14-1.fc16, php-eaccelerator-0.9.6.1-9.fc16.6, maniadrive-1.2-32.fc16.6 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Jan Lieskovsky 2012-08-28 10:09:46 UTC
The phar extension got introduced upstream starting from php 5.3.0 version:
http://php.net/releases/5_3_0.php

This issue did NOT affect the version of the php package, as shipped with Red Hat Enterprise Linux 5 as it did not include support for phar extension yet.

Comment 14 Jan Lieskovsky 2012-08-28 10:15:53 UTC
Statement:

This issue did not affect the version of php as shipped with Red Hat Enterprise Linux 5 as it did not include support for phar extension yet. This issue was addressed in php53 package for Red Hat Enterprise Linux 5 via RHSA-2012:1047 and in php package for Red Hat Enterprise Linux 6 via RHSA-2012:1046.