• 2008-06-21

    Data:_URI_scheme

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
    http://superhei.blogbus.com/logs/23355141.html

    Data:_URI_scheme

    前几天FD上公布了一个vbb的xss: http://seclists.org/fulldisclosure/2008/Jun/0181.html,这个bug比较有意思:

    admincp/index.php?redirect=data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K

    代码:admincp/index.php 98-107

    if (!empty($vbulletin->GPC['redirect']))
    {
        require_once(DIR . '/includes/functions_login.php');
        $redirect = htmlspecialchars_uni(fetch_replaced_session_url($vbulletin->GPC['redirect']));

        print_cp_header($vbphrase['redirecting_please_wait'], '', "<meta http-equiv=\"Refresh\" content=\"0; URL=$redirect\" />");
        echo "<p>&nbsp;</p><blockquote><p>$vbphrase[redirecting_please_wait]</p></blockquote>";
        print_cp_footer();
        exit;
    }

    http-equiv里的url使用data:text/html 实现xss。

    在firefox官方的资料:http://www.mozilla.org/quality/networking/testing/datatests.html
    wiki的资料:http://en.wikipedia.org/wiki/Data:_URI_scheme

    可以看得出来data:类似于javasript:,那么这个估计可以跨很多程序了,在你测试xss不要忘记了data:

    data:有几个特点:
       
        1.可以指定MIME-type如text/html
        2.可以指定编码如data:;charset=UTF-8,Hello
        3.firefox/ie8/Opera等支持它
        

    收藏到:Del.icio.us




    评论

  • IE8也支持这个该死的data:了?我日。