Bug 782657 (CVE-2012-0057) - CVE-2012-0057 php: XSLT file writing vulnerability
Summary: CVE-2012-0057 php: XSLT file writing vulnerability
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2012-0057
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: impact=moderate,public=20120111,repor...
Depends On: 819855 819856 830727 830728 830729 830730
Blocks: 782956 835958 835959 835960
TreeView+ depends on / blocked
 
Reported: 2012-01-18 03:30 UTC by Kurt Seifried
Modified: 2019-06-08 19:00 UTC (History)
6 users (show)

Fixed In Version: php 5.3.9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-27 17:19:25 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:1045 normal SHIPPED_LIVE Moderate: php security update 2012-06-27 19:48:39 UTC
Red Hat Product Errata RHSA-2012:1046 normal SHIPPED_LIVE Moderate: php security update 2012-06-27 19:48:23 UTC
Red Hat Product Errata RHSA-2012:1047 normal SHIPPED_LIVE Moderate: php53 security update 2012-06-27 19:47:13 UTC

Description Kurt Seifried 2012-01-18 03:30:01 UTC
Nicolas Grégoire nicolas.gregoire@agarri.fr

Please find attached the "php539-xslt.php" script.

This script displays by default a pre-filled HTML form including some
XML data and XSLT code. When the form is submitted, the user-controlled
XML data is transformed using the user-controlled XSLT code. Then, the
output of this transformation is displayed in the browser.

When executed, the pre-filled XSLT code will write
to /var/www/xxx/backdoor.php this content :

<html><body>
<h1><font color="red">I'm a (very) malicious PHP file !!!</font></h1>
<?php phpinfo()?>
</body></html>

Note : the payload is encrypted with RC4. A static key ("simple_demo")
embedded in the XSLT code is used to decrypt it.

Regards,
Nicolas

Original thread: http://seclists.org/oss-sec/2012/q1/138
This message: http://seclists.org/oss-sec/2012/q1/157

Comment 4 Tomas Hoger 2012-01-18 09:01:00 UTC
Upstream bug report:
https://bugs.php.net/bug.php?id=54446

Upstream commits:
http://svn.php.net/viewvc/?view=revision&revision=313160
http://svn.php.net/viewvc/?view=revision&revision=316530
http://svn.php.net/viewvc/?view=revision&revision=317759
http://svn.php.net/viewvc/?view=revision&revision=317801

There's a difference in between 5.4 and 5.3 fixes.  Both disable writing by default, however, there are different ways to control that default.  5.4 fix introduces XsltProcessor::setSecurityPrefs($options) and getSecurityPrefs(), while 5.3 fix adds new xsl.security_prefs ini option.

OSS-Security list discussion:
http://thread.gmane.org/gmane.comp.security.oss.general/6672

Comment 5 Tomas Hoger 2012-01-18 09:02:50 UTC
This was fixed upstream in 5.3.9:
http://www.php.net/ChangeLog-5.php#5.3.9

Comment 6 Huzaifa S. Sidhpurwala 2012-01-27 05:14:10 UTC
This issue has been addressed in the following security advisories for Fedora 15 and Fedora 16:

Fedora-15: https://admin.fedoraproject.org/updates/FEDORA-2012-0420/php-5.3.9-1.fc15
Fedora-16: https://admin.fedoraproject.org/updates/FEDORA-2012-0504/php-5.3.9-1.fc16

Comment 8 Huzaifa S. Sidhpurwala 2012-02-06 06:58:34 UTC
This issue affects the version of php as shipped with Red Hat Enterprise Linux 4, 5 and 6. This issue affects the version of php53 as shipped with Red Hat Enterprise Linux 5.

Comment 12 Bogdan 2012-06-22 08:22:03 UTC
Will there be any updates to php53 (RHEL 5) to address this problem?
Thanks

Comment 13 errata-xmlrpc 2012-06-27 15:52:10 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2012:1047 https://rhn.redhat.com/errata/RHSA-2012-1047.html

Comment 14 errata-xmlrpc 2012-06-27 15:52:46 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2012:1046 https://rhn.redhat.com/errata/RHSA-2012-1046.html

Comment 15 errata-xmlrpc 2012-06-27 15:54:01 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2012:1045 https://rhn.redhat.com/errata/RHSA-2012-1045.html


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