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

Expire authentication token upon app restart #250

Open
MarcS1975 opened this issue Oct 16, 2024 · 5 comments
Open

Expire authentication token upon app restart #250

MarcS1975 opened this issue Oct 16, 2024 · 5 comments
Labels
suggestion An enhancement that may be considered in the future

Comments

@MarcS1975
Copy link

I logged into an existing Flatnotes application using my password. All fine and all my docs were shown.
Then I noteiced that restarting the container keeps me logged into the website. This shuld not happen.
Even deleting the container and the docker image and re-installing an updated Faltnotes image does not require me to log in again.
I think these are major security risks. Any change of the underlying system should autmooatically kick the user out and force re-login.

@MarcS1975 MarcS1975 changed the title Security issues Bug: Security issues Oct 16, 2024
@dullage
Copy link
Owner

dullage commented Oct 16, 2024

Hi @MarcS1975. I don't agree that this is a security risk. Why should a restart of the container be related to invalidating user sessions? Maybe you just restarted the server for maintenance. Surely you wouldn't want this to kick you out?

What's happening under the hood is that the login process generates a token. This token is only invalidated by the following events:

  1. The token expires. This is controlled by the FLATNOTES_SESSION_EXPIRY_DAYS environment variable, which defaults to 30 days.
  2. The secret used to generate the token is changed. This is controlled by the FLATNOTES_SECRET_KEY environment variable.

So if you want to invalidate all existing sessions, simply update the secret key.

I hope this helps.

@dullage dullage added the triage required Requires input from a maintainer label Oct 16, 2024
@MarcS1975
Copy link
Author

MarcS1975 commented Oct 17, 2024 via email

@MarcS1975
Copy link
Author

MarcS1975 commented Oct 17, 2024 via email

@dullage
Copy link
Owner

dullage commented Oct 17, 2024

I understand that invalidating the token in these scenarios would, in some cases, enhance security. I'm sure there are many other things that could be done to enhance security. But I still don't agree that not doing so is a "major security risk".

@MarcS1975
Copy link
Author

Do you run your server with SSL directly exposed to the internet?

@dullage dullage changed the title Bug: Security issues Expire authentication token upon app restart Oct 19, 2024
@dullage dullage added suggestion An enhancement that may be considered in the future and removed triage required Requires input from a maintainer labels Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion An enhancement that may be considered in the future
Projects
None yet
Development

No branches or pull requests

2 participants