News for hackers. Stuff that matters.
Re:JWT should not be your default for sessions by wglb on Wednesday May 12, 2021 @10:34PM (#27137806)
Because the server thinks that the session is still alive. The server doesn't know that the client has "dropped" the session. If the dropped token should be somehow be found again, it still has all the authority that the original session did.
Re:JWT should not be your default for sessions by hkai on Wednesday May 12, 2021 @11:22PM (#27138053)
This got flagged by our pentest vendor as well, but to me it sounds like a very unrealistic attack vector.

If one can steal a token from your browser's storage or can intercept your HTTPS connection, then sure, yes, you have a huge vulnerability even without JWT.

Re:JWT should not be your default for sessions by quickthrower2 on Wednesday May 12, 2021 @11:40PM (#27138129)
Could make you less secure if the token was leaked somehow (another vuln for example a cross origin type of thing)

You notice odd behaviour so you log out to stop it but the attacker isn’t logged out.

Also with this setup log out of all devices is not possible! Again something you’d be keen to do if seemingly attacked.

Re:JWT should not be your default for sessions by porker on Thursday May 13, 2021 @02:43AM (#27139157)
I've never got my head round how log out of all devices works. It has to have a central store of all sessions?
Re:JWT should not be your default for sessions by lbriner on Thursday May 13, 2021 @03:31AM (#27139388)
It depends on what auth you are using.

In OpenID Connect, there are back channels that talk to each other so that all devices know you have logged out.

If you are using traditional auth then yes, you would need to track session state against the user so that when they access from a particular device, you could check whether they have already logged out.

Some more complex apps use a background thread to check auth status with the server.

Re:JWT should not be your default for sessions by porker on Thursday May 13, 2021 @08:26AM (#27141306)
Thanks for the insight. As Google has this feature I've wondered how they get it to scale up.
Re:JWT should not be your default for sessions by wglb on Thursday May 13, 2021 @12:16PM (#27143881)
> it sounds like a very unrealistic attack vector.

It isn't unrealistic at all. A lot of attack vectors seem unrealistic to the victim until they happen. How realistic is it to think that a hostile actor can inject their code into a build process without touching the disk, then get that corrupted executable signed; then that signed executable is installed by 18000 users with root permission?

Re:JWT should not be your default for sessions by ryanmarsh on Thursday May 13, 2021 @12:08AM (#27138291)
I’ve only done a few JWT implementations so forgive my ignorance but isn’t this what “exp” and token refreshes are for?

If you don’t want to maintain a centralized session store and you don’t want long lived tokens just set the expiry to 90 seconds. When you attempt a refresh, if the user is logged out it will fail.

I’m really confused by the either/or of “hit central session store on every request” or “tokens that live five minute too long are bad mmmkay”.

Re:JWT should not be your default for sessions by josephg on Thursday May 13, 2021 @02:03AM (#27138938)
Huh? To track if the user is logged in (for longer than 90 seconds) you’ll need another token, used to refresh the JWT token. And you’ll need the normal session infrastructure to validate that anyway.

That sounds like a very complex system to cache session tokens. You may as well just cache normal session tokens for 90 seconds in your application servers. Same result, less complexity.