有人只知道我当前的JSESSIONID冒充/劫持我的会话(Tomcat 7 / Glassfish 3.2))吗? [英] Can someone who merely knows my current JSESSIONID impersonate / hijack my session (Tomcat 7/Glassfish 3.2))?

查看:260
本文介绍了有人只知道我当前的JSESSIONID冒充/劫持我的会话(Tomcat 7 / Glassfish 3.2))吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个简单的英语,for dummies解释JSESSIONID如何在安全方面工作

I'm looking for a plain English, "for dummies" explanation of how does JSESSIONID work from security aspects


  • 可以是某人只知道我当前的JSESSIONID冒充/劫持我的会话?

  • 在什么情况下,JSESSIONID将成为URL的一部分,这是 OWASP#2安全风险(场景#1)仍然与最新版本的Tomcat / Glassfish相关,如果是,那么关闭/打开以防止它出现什么?

  • Can someone who merely knows my current JSESSIONID impersonate / hijack my session?
  • In what scenarios JSESSIONID will be part of the URL, and is this OWASP #2 security risk (scenario #1) still relevant for latest versions of Tomcat / Glassfish, and if so, what to "turn off/on" to prevent it?

推荐答案


问:有人只知道我当前的JSESSIONID冒充/劫持我的会话?

Q: Can someone who merely knows my current JSESSIONID impersonate / hijack my session?

答:是的。

这就是为什么您的网站小心使用Cookie非常重要。实际上,如果您担心数据包嗅探,这意味着您只应在通过HTTPS连接 1 发出请求时发送会话cookie。设置'httpOnly'标志有助于阻止客户端javascript等使用cookie。

That's why it is important that your site is careful with cookies. Indeed, if you are worried about packet sniffing, this means that you should only send the session cookie when the request was made over an HTTPS connection1. And setting the 'httpOnly' flag helps things by stopping client-side javascript, etc from using the cookie.


问:在什么情况下JSESSIONID将成为URL的一部分

Q: In what scenarios JSESSIONID will be part of the URL

答:通常,当网络服务器(在容器级别)将会话令牌放入网址:

A: Typically, this happens when the webserver (at the container level) puts the session token into the URL:


  • 作为用户浏览器未设置Cookie的解决方法,或

  • 来制作URL适合用于书签或通过电子邮件发送给其他人。

显然,这是不安全和不良做法..虽然短会话超时确实会缓解这种情况。 (或者,它可以通过HTTPS ...只要用户不与其他人共享URL 1 。)

Obviously, this is insecure and "bad practice" ... though a short session timeout does tend to mitigate this. (Alternatively, it is OK over HTTPS ... provided that the user doesn't share the URL with other people1.)

对于Tomcat 6.x,我认为阻止容器(永远)将会话ID添加到URL的方法是添加 disableURLRewriting =false 属性到上下文。

For Tomcat 6.x, I believe that the way to prevent the container from (ever) adding the session id to the URL is to add the disableURLRewriting="false" attribute to the context.

对于Tomcat 7:

For Tomcat 7:


Context.disableURLRewriting:已删除此内容。通过在Web应用程序或全局CATALINA_BASE / conf / web.xml文件中配置session-config / tracking-mode元素,可以获得等效的效果。

Context.disableURLRewriting: This has been removed. An equivalent effect can be obtained by configuring the session-config/tracking-mode elements in a web application or in the global CATALINA_BASE/conf/web.xml file.






1 - 这假设您已修补(等)您的网络服务器以解决已知的SSL端点漏洞。如果没有,您的HTTPS连接可能不安全。

这篇关于有人只知道我当前的JSESSIONID冒充/劫持我的会话(Tomcat 7 / Glassfish 3.2))吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆