Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1213407 - (CVE-2015-3411) CVE-2015-3411 php: missing null byte checks for paths in various PHP extensions
CVE-2015-3411 php: missing null byte checks for paths in various PHP extensions
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
impact=moderate,public=20150416,repor...
: Security
Depends On: 1213456 1228052 1228053 1228070 1228071 1228072 1228073 1228074 1228075 1228076 1228077
Blocks: 1213462
  Show dependency treegraph
 
Reported: 2015-04-20 09:42 EDT by Vasyl Kaigorodov
Modified: 2015-11-25 05:35 EST (History)
15 users (show)

See Also:
Fixed In Version: php 5.4.40, php 5.5.24, php 5.6.8
Doc Type: Bug Fix
Doc Text:
It was found that certain PHP functions did not properly handle file names containing a NULL character. A remote attacker could possibly use this flaw to make a PHP script access unexpected files and bypass intended file system access restrictions.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-07-09 17:32:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
PHP Bug Tracker 69353 None None None Never
Red Hat Product Errata RHSA-2015:1135 normal SHIPPED_LIVE Important: php security and bug fix update 2015-06-23 08:11:40 EDT
Red Hat Product Errata RHSA-2015:1186 normal SHIPPED_LIVE Important: php55-php security update 2015-06-25 08:31:54 EDT
Red Hat Product Errata RHSA-2015:1187 normal SHIPPED_LIVE Important: rh-php56-php security update 2015-06-25 08:43:17 EDT
Red Hat Product Errata RHSA-2015:1218 normal SHIPPED_LIVE Moderate: php security update 2015-07-09 17:01:41 EDT

  None (edit)
Description Vasyl Kaigorodov 2015-04-20 09:42:06 EDT
PHP versions 5.4.40, 5.5.24, and 5.6.8 provide a fix for multiple PHP extensions which did not check for NULL byte in a path when processing/reading a file which might lead to a sensitive information disclosure.

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

Upstream bug:
https://bugs.php.net/bug.php?id=69353
Comment 1 Vasyl Kaigorodov 2015-04-20 11:24:37 EDT
Created php tracking bugs for this issue:

Affects: fedora-all [bug 1213456]
Comment 2 Fedora Update System 2015-04-22 18:51:48 EDT
php-5.6.8-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-04-23 12:10:52 EDT
php-5.6.8-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-04-27 04:39:29 EDT
php-5.5.24-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-21 16:08:52 EDT
This is yet another CVE-2006-7243-like issue (which is tracked via bug 662707).  PHP allows NUL (\0) character in file names.  When such file names are passed to underlying C libraries, file name gets truncated at first \0, which causes PHP to use different file than intended.  This may have application specific consequences.

There are few cases mentioned in the upstream bug report:

- DOMDocument's load(), but upstream fix also covers loadHTMLFile(),  relaxNGValidate(), and schemaValidate() methods

- xmlwriter_open_uri / XMLWriter::openURI

- fileinfo_file - this issue only affects PHP 5.3.0 and later, older versions do not include fileinfo extension

- hash_hmac_file(), but upstream fix also covers hash_file() and hash_update_file()

Upstream fix covers additional cases not mentioned in the upstream bug:

- gd extension:
  - imageloadfont()
  - imagepsencodefont() - this case does not affect PHP packages in Red Hat
    products, as PHP GD extension there does not support Type1 fonts
  - imagecreatefrom*()

- pgsql extension - pg_trace()

- standard extension - readlink() - this was previously fixed as part of CVE-2006-7243.  However, the fix was regressed in PHP 5.4 and later:
  https://bugs.php.net/bug.php?id=69418

- standard extension - stream_resolve_include_path() - it seems this may only have impact if resolving a file form phar archive.  Outside of phar, resolution goes through function php_resolve_path() which already checks paths for NUL.  Function only exists in PHP 5.3.2 and later.

- zlib extension:
  - gzopen()
  - readgzfile()
  - gzfile() was fixed in PHP 5.4 as part of fix for CVE-2006-7243.  The fix
    that was applied to 5.3 did not add NUL check to gzfile().
Comment 6 Tomas Hoger 2015-05-21 16:14:44 EDT
Upstream fix can not be directly backported to PHP 5.3 as the upstream fix uses 'p' parameter parsing option for zend_parse_parameters().  This option was introduced upstream in version 5.4.  Fix either needs to be changed to do checks as strlen(filename) != filename_len and report error, or introduce support for 'p' parsing option (it was added upstream as part of CVE-2006-7243 fix).

http://git.php.net/?p=php-src.git;a=commitdiff;h=32b5f8a
Comment 9 Tomas Hoger 2015-05-28 08:01:31 EDT
Created new upstream bug report for some related cases where paths with NUL are still accepted:

https://bugs.php.net/bug.php?id=69719
Comment 14 Tomas Hoger 2015-06-05 10:48:53 EDT
The PHP packages as shipped as part of the php54 collection in Red Hat Software Collections were updated to fixed upstream version 5.4.40 via RHSA-2015:1066 released as part of Red Hat Software Collections 2.0.


This issue has been addressed in the php54-php packages in the following products:

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

Via RHSA-2015:1066 https://rhn.redhat.com/errata/RHSA-2015-1066.html
Comment 17 Tomas Hoger 2015-06-17 11:03:03 EDT
(In reply to Tomas Hoger from comment #5)
> There are few cases mentioned in the upstream bug report:

CVE-2015-3411 was assigned to the issues described in the upstream bug report.

> Upstream fix covers additional cases not mentioned in the upstream bug:

CVE-2015-3412 was assigned to the additional fixed part of the upstream commit.  Separate bug 1232823 was created for this CVE.

See the following oss-security mailing list post for details of the CVE assignment:

http://seclists.org/oss-sec/2015/q2/727
Comment 18 errata-xmlrpc 2015-06-23 04:12:57 EDT
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 19 errata-xmlrpc 2015-06-25 04:32:15 EDT
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 20 errata-xmlrpc 2015-06-25 04:43:37 EDT
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 21 errata-xmlrpc 2015-07-09 13:07:36 EDT
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

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