Tomcat 7 新特性学习之二 改变JSessionID来防止固定SessionID攻击

一个固定的Session攻击通常发生在以下情况:

1.恶意用户访问一个web site,这个JSessionID被保存在浏览器的cookie里面,即便用户并没有登录改网站。这种情况下,他就可以伪造一个带有该JsessionID的URL,并发送给受害者。(例如, http://example.com/login?JESSIONID=qwerty)

 

2.受害者点这个带有jsessionid的URL,提示输入验证信息之后就登陆系统。

 

3.攻击者现在使用这个带jsessionid的链接,以受害者的身份登陆进系统了。

 

It is trivial for the attacker to add a jsessionid in the URL as well as to send it in the header using a malicious form. (For a full description of session fixation attacks, read the whitepaper "Session Fixation Vulnerability in Web-based Applications " from Acros Security.)

The solution implemented by the Tomcat team is a patch that changes the jsessionid after authentication. This patch has been applied to Tomcat 7 and has also been backported to Tomcat 5 and 6 with some differences.

According to Mark Thomas , the results of this patch in Tomcat 7 are:

  • Tomcat is not vulnerable by default because the session ID changes upon authentication.
  • If this default is changed by the user (e.g. because the application can't handle a changing session ID), then the risks may be minimized by disabling session tracking via URL (a new feature in Servlet 3).

And in Tomcat 5 and 6, the results of the patch are:

  • Session fixation attacks can be prevented by enabling Tomcat to change the session ID on authentication (if there is insufficient support for this to be enabled by default).
  • If the application can't handle a changing session ID then the risks may be minimized by writing a custom filter that checks request.isRequestedSessionIdFromURL() and responds accordingly (e.g. rejecting the request).

The above changes work transparently behind the scenes; the developer does not have to do anything. The users session (jsessionid) is changed after login. This completely prevents session fixation attacks

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值