Bug 1223425 (CVE-2015-4021) - CVE-2015-4021 php: memory corruption in phar_parse_tarfile caused by empty entry file name
Summary: CVE-2015-4021 php: memory corruption in phar_parse_tarfile caused by empty en...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2015-4021
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: 1223447 1228052 1228053 1228054 1228055 1228056 1228057 1228058 1228059 1228060 1228061
Blocks: 1222994
TreeView+ depends on / blocked
 
Reported: 2015-05-20 13:34 UTC by Vasyl Kaigorodov
Modified: 2019-09-29 13:33 UTC (History)
16 users (show)

Fixed In Version: php 5.4.41, php 5.5.25, php 5.6.9
Doc Type: Bug Fix
Doc Text:
An integer underflow flaw leading to out-of-bounds memory access was found in the way PHP's Phar extension parsed Phar archives. A specially crafted archive could cause PHP to crash or, possibly, execute arbitrary code when opened.
Clone Of:
Environment:
Last Closed: 2015-07-09 21:50:31 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1135 0 normal SHIPPED_LIVE Important: php security and bug fix update 2015-06-23 12:11:40 UTC
Red Hat Product Errata RHSA-2015:1186 0 normal SHIPPED_LIVE Important: php55-php security update 2015-06-25 12:31:54 UTC
Red Hat Product Errata RHSA-2015:1187 0 normal SHIPPED_LIVE Important: rh-php56-php security update 2015-06-25 12:43:17 UTC
Red Hat Product Errata RHSA-2015:1218 0 normal SHIPPED_LIVE Moderate: php security update 2015-07-09 21:01:41 UTC
Red Hat Product Errata RHSA-2015:1219 0 normal SHIPPED_LIVE Moderate: php54-php security update 2015-07-09 22:53:28 UTC

Description Vasyl Kaigorodov 2015-05-20 13:34:06 UTC
It was reported that when phar_parse_tarfile() entry filename starts with NULL, this may lead to a single byte memory corruption.

Upstream report:
https://bugs.php.net/bug.php?id=69453

Upstream fix:
http://git.php.net/?p=php-src.git;a=commitdiff;h=c27f012b7a447e59d4a704688971cbfa7dddaa74
http://git.php.net/?p=php-src.git;a=commitdiff;h=e2bbf0a2df2cd864fa86d613eb316b249811a6f6

CVE request:
http://seclists.org/oss-sec/2015/q2/479

Comment 1 Vasyl Kaigorodov 2015-05-20 14:13:22 UTC
Created php tracking bugs for this issue:

Affects: fedora-all [bug 1223447]

Comment 2 Fedora Update System 2015-05-26 03:40:31 UTC
php-5.6.9-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 3 Fedora Update System 2015-05-27 16:13:14 UTC
php-5.6.9-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 4 Fedora Update System 2015-05-27 16:23:27 UTC
php-5.5.25-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Tomas Hoger 2015-05-28 15:06:57 UTC
If file name of a file in PHAR archive is empty, it causes out-of-bounds read.  Depending on platform, this out of bounds read may be likely to cause crash (e.g. on 64 bit platforms).  If the accessed memory is mapped and contains '/', it is overwritten with '\0' and file name length counter is decremented.  This may lead to further out of bounds accesses.

This issue should only be relevant in use case where Phar archives are opened / inspected, but no code is run from them.  Expected use of Phar archives is provide a single file bundle containing PHP application or library, and hence need to be fully trusted as code from archives is executed.

Comment 11 errata-xmlrpc 2015-06-23 08:13:35 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

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

Comment 12 errata-xmlrpc 2015-06-25 08:32:43 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS

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

Comment 13 errata-xmlrpc 2015-06-25 08:44:02 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS

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

Comment 14 errata-xmlrpc 2015-07-09 17:08:02 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6

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

Comment 15 errata-xmlrpc 2015-07-09 18:53:56 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS

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


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