Application_Liferay

Version 15.1 by Nicolas Gregoire on 2012/01/13 14:17

Dixit Wikipedia : "Liferay Portal is a free and open source enterprise portal written in Java and distributed under the GNU Lesser General Public License.[2] and proprietary licenses. It is primarily used to power corporate intranets and extranets. [...] Liferay Portal is Java based and runs on any computing platform capable of running the Java Runtime Environment and an application server. Liferay is available bundled with an servlet container such as Apache Tomcat."

The vulnerabilities described here were patched in version 6.0.6 GA (cf. the Release Notes for 6.0.6 GA).

Java code execution

LIferay includes numerous portlets. The "XSL Content" portlet displays the result of the XSL transformation of a XML document. The XSLT engine used by default is Xalan-J (but this can probably modified easily using JAXP). As Xalan-J allows by default to execute Java code from the stylesheet, that's an easy to exploit vulnerability. Any logged-in user can execute arbitrary Java code in the context of the Web Application server (usually Tomcat) : CVE-2011-1571.

Executing commands and reading the output (using the "xalanj-reading-stdout.xsl" script included on the Xalan-J page) :

liferay-execute-commands-with-stdout.png

Additional vulnerabilities

Two others vulnerabilities were identified in the "XSL Content" portlet :

  • CVE-2011-1503 : allows to read XML files via a file:// URL
  • CVE-2011-1502 : allows to read UTF-8 files and to list directories via a XEE (XML External Entity) attack

Reading /etc/passwd using CVE-2011-1502 :
liferay-read-etc-passwd-via-xee.png