XSS and the search module
Posted: Wed Dec 09, 2009 8:39 pm
an audit was dinging us for an XSS vulnerability related to the search form on the website. basically, a request for...
GET /cgi-bin/blah blah blah;
results in our 404 page, which includes...
blah blah blah;">
i'm pretty sure that no modern browser is going to parse a inside another tag's attribute, but there you have it.
this was resolved by making a change in lib/classes/module_support/modform.inc.php -> function __curPageURL
if ($_SERVER['REDIRECT_STATUS'] == '404') {
$str = '/';
} else {
$str = $_SERVER['REQUEST_URI'];
...
}
$pageURL .= $_SERVER["SERVER_NAME"].$str;
we didn't find what the client requested the first time, why would we use that URI again for anything?
GET /cgi-bin/blah blah blah;
results in our 404 page, which includes...
blah blah blah;">
i'm pretty sure that no modern browser is going to parse a inside another tag's attribute, but there you have it.
this was resolved by making a change in lib/classes/module_support/modform.inc.php -> function __curPageURL
if ($_SERVER['REDIRECT_STATUS'] == '404') {
$str = '/';
} else {
$str = $_SERVER['REQUEST_URI'];
...
}
$pageURL .= $_SERVER["SERVER_NAME"].$str;
we didn't find what the client requested the first time, why would we use that URI again for anything?