当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 不要小看注释掉的JS 引起的安全问题

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 不要小看注释掉的JS 引起的安全问题


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 317 ::
收藏到网摘: n/a

HTTP Response Splitting 攻击主要说明的是两个问题 一个是header插入问题。
另一个是\r\n问题。
我们来看这样一段代码:
1. test
2. <script>
3. //alert('<%=request.getParameter("username")%>');
4. </script>
大家都能看到,这好像有个漏洞,但是已经被补上了,注释掉了。
那既然注释掉了,就不该有问题了么?
不是的。
再看这个URL
http://localhost/index.jsp?username=kxlzx%0d%0a%0d%0aalert('kxlzx
很无奈吧?
生成了如下代码:
test
<script>
//alert('kxlzx
alert('kxlzx ');
</script>
注释掉的JS,也执行了。
所以,不要把没用的代码,注释掉的JS等,扔到html里。
代码审核是个细活,任何疏漏之处都值得注意。