what is the vulnerability of having Jsessionid on first request only

后端 未结 3 1488
半阙折子戏
半阙折子戏 2020-12-16 07:24

Recently we removed jsessionid from URL did cookies based session management to prevent \"session hijacking attack\"

But we found that first request URL always has

相关标签:
3条回答
  • 2020-12-16 07:54

    What you've done here could improve the overall security of the solution somewhat, but won't necessarily prevent session hijacking.

    the security issue with placing the session ID in the URL is that URLs are exposed in various places (eg, copy and pasted URLs could expose a live session, URLs can be stored in proxy server logs, web server logs and browser history), which could allow an attacker to grab a valid session ID and get access to your users data.

    Ideally you should remove the JSESSIONID from the URL in all places, and only use cookie storage.

    Additionally if you want to mitiate Session hijacking there's a number of other areas to consider.

    You need to use SSL on all pages where the session ID is passed (this is to mitigate the risk of the session ID being intercepted in transit (eg, the Firesheep attack).

    If the session ID is set before you authenticate the user, you should ensure that a new session ID is issued when the user logs in.

    Also if possible the session cookies should be use of the httpOnly and secure flags, to reduce the risk of them being leaked over cleartext channels.

    There's some good additional information on the OWASP Site

    BTW if you've got more question on the security side of things, there's a stack exchange site specifically for that at Security.stackexchange.com

    0 讨论(0)
  • 2020-12-16 07:56

    did cookies based session management to prevent "session hijacking attack"

    Whats stopping the cookie being hijacked?

    Session managment is a server side thing - You need to server to check (based on the cookie) that the user is meant to be logged in.

    I don't think you've improved security here at all to be honest, take a look at this excellent article to see why.

    0 讨论(0)
  • 2020-12-16 08:14

    If someone gets hold of the session id then they pretty much hijack the whole session, see Predictable Session IDs vulnerability.

    0 讨论(0)
提交回复
热议问题