Unwakeable XSS Vulnerability

It was brought to my attention a couple days ago that Unwakeable 1.2 contains a cross-site scripting (XSS) vulnerability in the search piece. To test to see if you’re vulnerable, search for this on your Unwakeable site:

<script>alert('XSS Vulnerability!');</script>

If you see a javascript popup after searching, you’re vulnerable to attack and should follow the steps below to fix the vulnerability in Unwakeable 1.2. I’ve already taken steps to fix this vulnerability in Unwakeable 2.0, which will be released shortly.

To fix your installation of Unwakeable 1.2 you need to edit three files: serchform.php, theloop.php, and header.php.

1. searchform.php

First, open searchform.php and change this piece on line 8:

<form method="get" id="searchform" action="<?php echo $_SERVER['PHP_SELF']; ?>">

to this:

<form method="get" id="searchform" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>">

2. theloop.php

Next, open theloop.php and change this piece on line 42:

printf(__('Search Results for \\'%s\\'','k2_domain'), $s);

to this:

printf(__('Search Results for \\'%s\\'','k2_domain'), htmlspecialchars($s));

3. header.php

Finally, open header.php and change this code on line 6:

Search for <?php echo $s;

to this:

Search for <?php echo htmlspecialchars($s);

That’s it, once you’ve made those three changes you should no longer be vulnerable to this cross-site scripting attack. To make sure, just perform the search I mentioned above. It should no longer produce a javascript pop-up.

You can find out more about this vulnerability at blogsecurity.net. They have a tool called WordPress Scanner that will scan your WordPress installations for security problems.

Let me know if this fix doesn’t work for any of you.

Popularity: 19% [?]

5 Responses to “Unwakeable XSS Vulnerability”


  1. 1 looomz

    hi there..

    i have problem with header.php i couldnt find

  2. 2 Tyler

    Looomz: I think you can’t find it because it looks like you’ve modified your header.php to display a different title than a typical installation of Unwakeable.

    I did a little test on your blog and didn’t receive a javascript pop-up, which is good. So, you’re not vulnerable to this XSS vulnerability. There’s nothing more you need to modify to protect yourself.

    Let me know if you’ve got any more questions or concerns.

  3. 3 looomz

    thanks alot man ur the best :)

  4. 4 Colin

    Yep, I’m vulnerable. I’mma patch it tomorrow morning if I have time before school. :P

  5. 5 Mike Jones

    Tyler, thaks for this patches!

Leave a Reply

Quicktags:

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution.



cheap xbox 360 games - buy from zavvi
cheap xbox 360 games - zavvi

mobile phones - Web Design - Mortgage Calculator - Mortgages - Guitar Lessons - Credit Counseling
Bike Insurance - Landlords Insurance - Search Engine Marketing - Mobile Phone



people-charming