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
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