Appscan安全漏洞修复
作者:网络转载 发布时间:[ 2014/8/15 15:17:02 ] 推荐标签:软件测试工具 安全测试工具 Appscan
1.会话标识未更新:登录页面加入以下代码
request.getSession(true).invalidate();//清空session
Cookie cookie = request.getCookies()[0];//获取cookie
cookie.setMaxAge(0);//让cookie过期
request.getSession(true).invalidate();//清空session
Cookie cookie = request.getCookies()[0];//获取cookie
cookie.setMaxAge(0);//让cookie过期
不是很明白session的机制,高手路过可以指教一下。
2.跨站点请求伪造:
在出错的url加参数sessionid。
response.getWriter().write( "<script>parent.location.href='dbase/admin/loginJsp.action?sessionId="+sessionId+"'</script>");
response.getWriter().write( "<script>parent.location.href='dbase/admin/loginJsp.action?sessionId="+sessionId+"'</script>");
如果带参数报ssl错误,使用下面的post方式传值:
response.getWriter().write(
"<script language="javascript"> " +
"document.write("<form action=dbase/admin/loginJsp.action method=post name=formx1 style='display:none'>");" +
"document.write("<input type=hidden name=name value='"+sessionId+"'");" +
"document.write("</form>");" +
"document.formx1.submit();" +
"</script>"
);
response.getWriter().write(
"<script language="javascript"> " +
"document.write("<form action=dbase/admin/loginJsp.action
method=post name=formx1 style='display:none'>");" +
"document.write("<input type=hidden name=name value='"+sessionId+"'");" +
"document.write("</form>");" +
"document.formx1.submit();" +
"</script>"
);
3.启用不安全HTTP方法
修改web工程中或者服务器web.xml,增加安全配置信息,禁用不必要HTTP方法
<security-constraint>
<web-resource-collection>
<url-pattern>/*</url-pattern>
<http-method>PUT</http-method>
<http-method>DELETE</http-method>
<http-method>HEAD</http-method>
<http-method>OPTIONS</http-method>
<http-method>TRACE</http-method>
</web-resource-collection>
<auth-constraint>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11