Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • I was thinking more along the lines that Mallory was seeing non-TLS traffic, such as the initial request to bob.com before Alice started logging in and the connection switches to HTTPS, thus was a passive MitM to collect the session ID and not trigger any TLS warnings, thus once TLS is established, the connection is secure, and only becomes an active attacker once they attempt to connect through the WebSocket. Commented Jul 30, 2015 at 18:41
  • Thank you, though; that does stress the need to ensure that the Secure and non-Secure session ID cookie doesn't mix, and that the non-Secure session ID never points to an authenticated user. I'm working on implementing TLS and session management in open source WS server software, so while I can most certainly stress the importance of not mixing secure and non-secure session IDs, I can't enforce it on the systems that implement the server, so the eavesdropping is still an issue. I'll update my question. Commented Jul 30, 2015 at 18:47
  • By the time the user is logging in, the connection should already be encrypted. If it is not, then this would be a problem. Commented Jul 30, 2015 at 18:47
  • 1
    I see what you mean, and I agree with you. You can't associate a session ID with an authenticated user until after the user logs in. And the user can't login until after TLS is established. So, first encrypt, then login, then session ID. This should be safe. If there is a MitM, then no login should happen at all. (In a perfect world where people heed the warnings.) Commented Jul 30, 2015 at 18:53
  • I just realized that there is no way to authenticate the HTTPS connection based on session ID alone either, if the session ID is also suspect in the WSS connection. (Or more precisely, verify that Mallory isn't hijacking the session, because any party in a TLS connection can start a brand new connection at any time.) Thus, if the session isn't regenerated on the Web side after logging in (and obviously after starting TLS) but before starting WebSockets, then the WebSocket side can never be securely authenticated. Commented Jul 30, 2015 at 20:29