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

Short lived and one-time-use tokens for authentication endpoints #12

Open
fisher60 opened this issue Mar 2, 2023 · 2 comments
Open
Labels
backend Relates to backend enhancement New feature or request vulnerability

Comments

@fisher60
Copy link
Member

fisher60 commented Mar 2, 2023

Summary

When a service attempts to login with abandonauth, they are given a temporary token that is used to identify them on the respective service. This token is currently a regular JWT with a relatively long lifetime, it can also be used multiple times to authenticate a single user. This is a security vulnerability. The token should be as short lived as possible and also only be valid for a single use.

Acceptance Criteria

  • Temporary JWTs have a very short lifespan, no more than 60 seconds
  • We cache all the currently issued, valid and unused tokens on abandon auth
  • An endpoint exists to check that a given token is in this cache of valid/unused tokens
  • An endpoint exists to burn short-lives tokens (pop them from the cache of valid tokens)
    • This allows a service to call the endpoint and burn a token that is known to be consumed
  • Garbage collector exists to remove all unused and expired tokens from this cache
    • This is to prevent the cache from becoming a memory leak
@fisher60
Copy link
Member Author

fisher60 commented Mar 3, 2023

addressed in #13

But due to config issues, we are unable to set the lifespan of the JWT to be short lived in the deployment repo.

@fisher60
Copy link
Member Author

We will expand this issue to make tokens truly one-time-use. We should force tokens to be invalidated after a single use to identify a user. This means the /me endpoint should burn a token when it is used to call this endpoint (if it is a temporary token).

@fisher60 fisher60 added the enhancement New feature or request label Jun 8, 2023
@fisher60 fisher60 added this to the Initial Release milestone Oct 26, 2023
@fisher60 fisher60 added the backend Relates to backend label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Relates to backend enhancement New feature or request vulnerability
Projects
None yet
Development

No branches or pull requests

1 participant