Bug 1213407 (CVE-2015-3411)
Summary: | CVE-2015-3411 php: missing null byte checks for paths in various PHP extensions | ||
---|---|---|---|
Product: | [Other] Security Response | Reporter: | Vasyl Kaigorodov <vkaigoro> |
Component: | vulnerability | Assignee: | Red Hat Product Security <security-response-team> |
Status: | CLOSED ERRATA | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | unspecified | CC: | bleanhar, ccoleman, dmcphers, fedora, jdetiber, jialiu, jkeck, jokerman, jorton, kseifried, lmeyer, mmaslano, mmccomas, rcollet, webstack-team |
Target Milestone: | --- | Keywords: | Security |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
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 21:32:21 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: | 1213456, 1228052, 1228053, 1228070, 1228071, 1228072, 1228073, 1228074, 1228075, 1228076, 1228077 | ||
Bug Blocks: | 1213462 |
Description
Vasyl Kaigorodov
2015-04-20 13:42:06 UTC
Created php tracking bugs for this issue: Affects: fedora-all [bug 1213456] 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. 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. 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. 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(). 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 Created new upstream bug report for some related cases where paths with NUL are still accepted: https://bugs.php.net/bug.php?id=69719 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 Additional commits for tests http://git.php.net/?p=php-src.git;a=commit;h=a643ccfb90750e0d830106588d2a46af87706b5b http://git.php.net/?p=php-src.git;a=commit;h=1defbb25ed69e7a1a90e2bcb2ee3b9190ea06577 (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 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 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 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 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 |