Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:16920
HistoryMay 03, 2007 - 12:00 a.m.

Wordpress All versions XSS

2007-05-0300:00:00
vulners.com
15

Advisory by Jose Carlos Norte

Wordpress is vulnerable to XSS attacks when custom 404 pages are used by the template.

The problem (sidebar.php):

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

if wordpress template use custom 404 pages, like:

<?php get_header(); ?>

    &lt;div id=&quot;content&quot; class=&quot;narrowcolumn&quot;&gt;

            &lt;h2 class=&quot;center&quot;&gt;Error 404 - Not Found&lt;/h2&gt;

    &lt;/div&gt;

<?php get_sidebar(); ?>

$_SERVER['PHP_SELF']; can contain special characters to break out html and perform XSS attacks, example:

http://www.example.com/index.php/&quot;&gt;&lt;script&gt;alert&#40;document.cookie&#41;&lt;/script&gt;

if no custom 404 page set by wordpress theme this attacks is not posible.