Jan 22

javascript事件解码引起的问题 不指定

woyigui , 18:39 , 网络安全 , 评论(7) , 引用(0) , 阅读(1571) , Via 本站原创 | |
   在javascript 事件中,当参数是经过编码的值,javascript 会将期解码进行执行,如下代码。
<a href=# onmousemove="&#97;&#108;&#101;&#114;&#116;&#40;&#47;&#119;&#111;&#121;&#105;&#103;&#117;&#105;&#47;&#41;">xxx</a>

另外,由于 javascript 支持 函数参数可以是 函数特性,如下代码:
<script>x( alert(1) );</script>

利用两种特性,就可以引发如下的安全问题:
<a href="#" onmousemove="xxx('&#39;+alert(1)+&#39;',44);return false;">woyigui</a>

当 javascript 代码经过编码带入页面,可以利用事件执行时解码的特性对单引号进行闭合,然后利用 函数参数 可以是 函数的特性进行代码。该方法不能直接用于 《script》内,比如如下代码是不能执行的:
<script>
xxx('&#39;+alert(1)+&#39;');
</script>

由于如上问题,在特定应用环境中,处理与解决 DOM 型XSS 的时候,将更具有挑战。解决方法就是在解码后,再次使用 \ 符号对其处理,但是考虑到特殊应用可能有所影响。
Tags:
Ivan
2010/03/15 20:19
经典
空灵 Email Homepage
2010/03/01 12:46
学习了
冷风吹 Homepage
2010/02/24 15:52
借鉴了哦。。。。
xixi
2010/02/06 18:01
偶像。。。看官快献菊。。
MJ Homepage
2010/01/30 22:01
是可以借鉴一下的
kxlzx
2010/01/28 10:37
在js执行的地方,要做jsencode,而不是htmlEncode等编码。
woyigui 回复于 2010/01/28 13:33
是呀,就是出在未正确的处理上。
youstar Homepage
2010/01/24 21:09
XSS有时可以借鉴下!
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]
               

 
20100511 NFL jerseysNFL jerseysNFL jerseys, louis vuitton bagslouis vuitton bagslouis vuitton bags, nike shoesnike shoesnike shoes, coach bagscoach bagscoach bags, jordan shoesjordan shoesjordan shoes, coach bagscoach bagscoach bags, tiffany jewelrytiffany jewelrytiffany jewelry, Shox r4Shox r4Shox r4, Shox nzShox nzShox nz, Shox nzNike dunk sbNike dunk sb, ghd straightenersghd straightenersghd straighteners, coach outletcoach outletcoach outlet, replica rolexreplica rolexreplica rolex, breitling watchesbreitling watchesbreitling watches, replica rolex watchesreplica rolex watchesreplica rolex watches, tag heuer carreratag heuer carreratag heuer carrera, replica louis vuitton replica louis vuitton replica louis vuitton , replica chanelreplica chanelreplica chanel, wholesale handbagswholesale handbagswholesale handbags, wholesale bagswholesale bagswholesale bags, jimmy choojimmy choojimmy choo, christian louboutinchristian louboutinchristian louboutin, yves saint laurent shoesyves saint laurent shoesyves saint laurent shoes, christian louboutinchristian louboutinchristian louboutin, ghdghdghd, ghd hairghd hairghd hair, 外贸网店建设外贸网店建设外贸网店建设, seoseoseo, 圣荷圣荷圣荷,