Zanardi
Zanardi
Offline
0
Hello,

After a check of my website for vunerabilities, I have found that the plug in contentstatitics is vunerable to XSS attack:

if I do :
mywebsite.com/?test="%3Balert%281%29%3B"
then an alert javascript button pops up.

I have narrowed the problem to this:

//new for v2
$uri = JFactory::getURI();
$document = JFactory::getDocument();

$thevars = JRequest::get('get');

//not interested in these vars
unset($thevars['task']);

$url_append = "";

foreach($thevars as $var => $value){
if(!is_array($value)) $url_append .= "&".$var."=".$value;
}

$document->addScriptDeclaration('var cs_module_append_url = "'.$url_append.'";');

The plug-in copies the exact url and is giving the following output:
var cs_module_append_url = "&query=";alert(1);"&option=com_sppagebuilder&view=page&id=31&Itemid=1365";

Since my site was attacked recently, I had to provide a quick and very simple fix:
if(!is_array($value)) {
$url_append .= "&".htmlspecialchars($var, ENT_QUOTES,'UTF_8')."=".htmlspecialchars($value, ENT_QUOTES,'UTF_8');
}

I do not know yet, if it will have an impact on my stats.

Best regards,

CZ
Responses (1)
  • Accepted Answer

    Thursday, May 24 2018, 09:29 AM - #Permalink
    0
    hello

    thanks a lot for notifying us.

    This won't have had any effect on stats. These vars are used for possible third party component filters.

    in any case, we're going to apply a fix to this right away

    many thanks!
    The reply is currently minimized Show
Your Reply