News for hackers. Stuff that matters.
Re:Stop using JWT for sessions (2016) by justaaron on Thursday November 01, 2018 @10:13AM (#18354026)
what about setting a secure cookie with a jwt, and expiring it when you log-out? what is the utility in server-sessions? (aside from the ability to revoke it at any time from the server.)
Re:Stop using JWT for sessions (2016) by anon1252 on Thursday November 01, 2018 @10:38AM (#18354253)
> and expiring it when you log-out?

and how would you do that if the user doesn't actively log out of a service?

Re:Stop using JWT for sessions (2016) by justaaron on Thursday November 01, 2018 @06:57PM (#18359227)
set the cookie in the response to their next request to you?

specifics depend upon the language and framework used on the server, etc...

Re:Stop using JWT for sessions (2016) by detaro on Thursday November 01, 2018 @10:40AM (#18354276)
Do you mean "delete the cookie" with "expiring it"? Then that doesn't help against an attacker which already has obtained the JWT, they can still use the JWT until it's expiry.
Re:Stop using JWT for sessions (2016) by justaaron on Thursday November 01, 2018 @06:55PM (#18359204)
what i propose: 1) login = sending username and hashed password (over tls) that does a bcrypt etc, compares to bcrypted etc hash in db, if correct = provide a jwt set as a cookie with "secure httpOnly", jwt should be logged.

2) logout = request to server, server sets cookie with "token=empty;expires:1970yaddayadda" as it's httpOnly there's no client-side messing baout with the cookie otherwise

3)_all pages send cookie with each request, so must be tls

upon logout, cookie has empty token, must be re-set with new token. old token, if stolen, can be compared with logged history, etc.

what do you see, in terms of flaws?

Re:Stop using JWT for sessions (2016) by justaaron on Thursday November 01, 2018 @11:10AM (#18354626)
so, what about a single-use token you exchange for another token (or not)?