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

Javascript
Add a Table to a Word Document
Add Formatted Text to a Word Document
用jscript实现新建word文档
用jscript实现新建和保存一个word文档
Open and Print a Word Document
Use Word to Search for Files
Convert Seconds To Hours
Sample script that deletes a SQL Server database
Sample script that displays all of the users in a given SQL Server DB
firefox中用javascript实现鼠标位置的定位
div+css实现鼠标放上去,背景跟图片都会变化。
Locate a File Using a File Open Dialog Box
Save a File Using a File Save Dialog Box
用jscript实现列出安装的软件列表
List the Stored Procedures in a SQL Server database
Display SQL Server Login Mode
Display SQL Server Version Information
List all the Databases on a SQL Server
用jscript启动sqlserver
Stop SQL Server

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 331 ::
收藏到网摘: 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里。
代码审核是个细活,任何疏漏之处都值得注意。