Bug 1260711 (CVE-2015-6837, CVE-2015-6838)

Summary: CVE-2015-6837 CVE-2015-6838 php: NULL pointer dereference in XSLTProcessor class
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: bleanhar, ccoleman, dmasirka, dmcphers, fedora, gscott, 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.45, php 5.5.29, php 5.6.13 Doc Type: Bug Fix
Doc Text:
A NULL pointer dereference flaw was found in the XSLTProcessor class in PHP. An attacker could use this flaw to cause a PHP application to crash if it performed Extensible Stylesheet Language (XSL) transformations using untrusted XSLT files and allowed the use of PHP functions to be used as XSLT functions within XSL stylesheets.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-12 21:14:22 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: 1260712, 1305856, 1305857    
Bug Blocks: 1260756, 1306180    

Description Adam Mariš 2015-09-07 13:47:34 UTC
The XSLTProcessor class misses a few checks on the input from the libxslt library. The valuePop() function call is able to return NULL pointer and php does not check that.

Upstream report:

https://bugs.php.net/bug.php?id=69782

Upstream patch:

http://git.php.net/?p=php-src.git;a=commit;h=1744be2d17befc69bf00033993f4081852a747d6

Comment 1 Adam Mariš 2015-09-07 13:48:02 UTC
Created php tracking bugs for this issue:

Affects: fedora-all [bug 1260712]

Comment 2 Adam Mariš 2015-09-09 09:11:02 UTC
CVE assignment:

http://seclists.org/oss-sec/2015/q3/524

Comment 3 Fedora Update System 2015-09-14 22:19:18 UTC
php-5.6.13-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-09-14 23:18:50 UTC
php-5.6.13-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 5 Fedora Update System 2015-09-18 18:37:43 UTC
php-5.6.13-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Tomas Hoger 2015-10-12 21:14:22 UTC
This issue is triggered by a specially-crafted / malicious Extensible Stylesheet Language (XSL).  Additionally, it requires XSLTProcessor to allow the use of PHP functions as XSLT functions (see XSLTProcessor::registerPHPFunctions).

The use of untrusted XSLTs has its own security concerns even without the ability to call PHP functions and without this flaw - they may allow DoS, XSS, or file content disclosure attacks.  When unrestricted use of PHP functions is allowed, this flaw should not be assume to cross any trust boundary.

As this flaw triggers NULL pointer dereference, its impact is limited to crash of the PHP interpreter.  When PHP is used with httpd using mod_php, crash may only impact attacker's own request (when using prefork mpm, which is still the default in Red Hat Enterprise Linux) or requests of several other uses (when using worker or event mpm).

In Red Hat Enterprise Linux and Fedora, the affected xsl extension is packaged in a separate sub-package php-xml.  Systems without the php-xml installed can not be affected by this issue.

Note that this actually triggers a bug in libxml2 library that was fixed upstream in version 2.9.2 using this commit:

https://git.gnome.org/browse/libxml2/commit/?id=03c6723043775122313f107695066e5744189a08

PHP was correctly assuming that libxml2's valuePop() should not return NULL.

Statement:

Red Hat Product Security has rated this issue as having Low security impact. This issue is not currently planned to be addressed in future updates. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.

Comment 9 errata-xmlrpc 2016-03-15 20:57:48 UTC
This issue has been addressed in the following products:

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

Via RHSA-2016:0457 https://rhn.redhat.com/errata/RHSA-2016-0457.html