Endpoint Protection

 View Only

WordPress XSS Exploit Solves Problems… and Creates More! 

Aug 01, 2007 03:00 AM

A proof-of-concept code exploiting newly discovered XSSvulnerabilities for the latest version of Wordpress (2.2.1) was postedtoday on a security blog.

The researcher unveiled seven vulnerabilities, cross-site scripting(XSS) or SQL injections, whose consequences range from benign toserious, the critical ones potentially leading to blog compromising. Inhis haste to show his skills, this person also released aproof-of-concept (PoC) code exploiting one of these vulnerabilities.

The PoC in itself, as explained, is supposedly not malicious, and isdesigned to raise awareness and patch vulnerable versions of theWordPress publishing platform. In a few words, here’s how it works:

  • A WordPress administrator browses the “Comments manager” in the administration panel
  • She clicks a link, which redirects to the PoC author’s Web page.This page checks the referrer, to see whether it might originate from alogged-on WordPress administrator (the URL would contain “wp-admin”)
  • If it does, a JavaScript routine is loaded to notify the user thatWordPress has been detected and that the blog might be potentially atrisk
  • The user can choose to carry on, as the pop-up message offers to hot-patch some vulnerabilities!
  • From there, an XSS vulnerability is exploited in upload.php,located under the wp-admin folder. It is used to patch three vulnerablefiles: link-import.php, options.php and upload.php.
  • The author is then asked to link the author’s page in the Blogroll section, in order to encourage more users to do the same.


A patch may look something like the following:


/*
Security Patch added by the xxxx
by xxxx http://...
*/
$style = preg_replace('/[^A-Za-z]/', '', $style);
/* end of patch */

In this example, the patch adds a sanity check for the stylevariable, used in upload.php. This is the same vulnerability that isused to modify WordPress in the first place.

Though the author’s goal is honorable, the code used to patch thethree aforementioned files seems to be buggy itself. The files modifiedare, in fact, fully overwritten. In doing that, the author forgot toencode the ‘+’ letter, which gets interpreted as a space by thebrowser. This means that all instances of the ‘+’ character in thethree files are replaced by spaces. One bug is then introduced inlink-import.php, where ‘$i++’ gets replaced by ‘$i ’ in a loop. I’lllet you draw the consequences... a bug affecting a regular expressionfilter would also affect options.php.

Be very careful if you consider patching your WordPress systemthrough this ‘obscure’ channel. Holes may be patched, but bugs may beintroduced as well.

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Related Entries and Links

No Related Resource entered.