stormpath / express-stormpath

Build simple, secure web applications with Stormpath and Express!
http://docs.stormpath.com/nodejs/express/
Apache License 2.0
325 stars 111 forks source link

Logout succeeds without token revocation #605

Open sshymko opened 7 years ago

sshymko commented 7 years ago

Built-in endpoint /logout returns successful 200 OK status even when no tokens (access and/or refresh) have been revoked. That can happen when no tokens have been passed as part of a request as they're not required.

This behavior opens the door for mistakes in a client application that can easily go unnoticed because the "logout" appears to succeed.

The expected behavior would be to require passing access token. The call should succeed upon invalidation of a known token only.

Refresh token being optional allows to mistakenly omit it in the request as well. That can easily happen due to the domain/path scope of cookies. In this case the "logout" will be misinterpreted as successful even though the refresh token remains valid.