好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

XSS with $(location.hash) - 网站安全 - 自学php

夜睡不着,翻SF的maillist,刚好看到有人发了条jquery导致的xss

挺有意思的.貌似作者是日本人. http://ma.la/jquery_xss/

作者给出了一个demo很简单.

1

2

3

4

5

<script type= "text/javascript" > // <![CDATA[

     $( function (){

         try { $(location.hash) } catch (e) {}

     })

// ]]></script>

访问 http://ma.la/jquery_xss/#<img src=/ onerror=alert(1)> 就会触发xss 漏洞原因也很简单,官方已经修复.

1

$("#id") is css selector, $("&lt;img&gt;") is createElement, and $("#&lt;img&gt;") is createElement too.

亮点在最后作者给出了example,第一次看到有人这样给example: Google Code Search

 

from:87年 blog

查看更多关于XSS with $(location.hash) - 网站安全 - 自学php的详细内容...

  阅读:47次