Remix.run Logo
hackermondev 16 hours ago

Discord puts the authentication token in local storage

edoceo 11 hours ago | parent [-]

Is that a problem on its own? It's like, encrypted right? Maybe a time sensitive token?

socketcluster 7 hours ago | parent | next [-]

Not a problem in itself. Also, there's not much point of encrypting tokens. The attacker could use the encrypted token to authenticate themselves without having to decrypt. They could just make a request from the victim's own browser. They could do this with cookies too even with httpOnly cookies.

XSS is a big problem. If a hacker can inject a script into your front end and make it execute, it's game over. Once they get to that point, there's an infinite number of things they can do. They basically own the user's account.

arethuza 5 hours ago | parent [-]

Does anyone actually encrypt the contents of JWTs? I'd have thought that anyone who has concerns about the contents of the token being easily visible would be likely to avoid JWTs anyway and just use completely opaque tokens?

seangrogg 9 hours ago | parent | prev [-]

Depends on the token; JWTs usually have payloads that are only base64 encoded. As well, if there's a refresh token in there it can be used to generate more tokens until invalidated (assuming invalidation is built in).