Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect checking iat for revocation #463

Open
0xc22b opened this issue May 6, 2023 · 0 comments
Open

Incorrect checking iat for revocation #463

0xc22b opened this issue May 6, 2023 · 0 comments

Comments

@0xc22b
Copy link

0xc22b commented May 6, 2023

Describe the bug
After set revocation by calling revoke-all, can't sign in anymore

To Reproduce
Steps to reproduce the behavior:

  1. Post a request to revoke-all
  2. Sign out and sign in

Expected behavior
All existing auth tokens cannot be used anymore. A new auth token should be able to work.

Additional context

  • There is no iat in auth token but in authentication.ts:302, if there is oldestValidTokenTimestamp, iat is required in the token. So every auth token will all be invalid.
  • It's already correct that iat should not be in the auth token as the token can be created again and again by an app i.e. if a request fails, @stacks/storage will try again with a new auth token.
  • If there is iat in an auth token, revocation will be useless i.e. an app just creates a new auth token with a newer timestamp for iat.
  • iat should be in an association token which it already is. With this, user needs to sign out and sign in again with a new association token.
  • So in authentication.ts, checking for revocations should not be in isAuthenticationValid (line 301-316), but should be in checkAssociationToken instead.

PS. I know you all are busy. I just leave a message here that can't use revoke right now or won't be able to access data in that account again. 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant