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

migrate-secret-key Fails to Update Secrets #181

Open
Samk13 opened this issue Mar 25, 2024 · 1 comment
Open

migrate-secret-key Fails to Update Secrets #181

Samk13 opened this issue Mar 25, 2024 · 1 comment

Comments

@Samk13
Copy link
Member

Samk13 commented Mar 25, 2024

Package version (if known): V12 latest

Describe the bug

After changing the SECRET_KEY in invenio.cfg and running invenio instance migrate-secret-key --old-key CHANGE_ME, users are unable to log in with the message "incorrect password". It appears the command accepts any value as old-key without regenerating the secrets with the new secret key, posing a potential security risk to not be able to access the system after.

Steps to Reproduce

  1. Create a user using user/password method
  2. Make sure you able to login with your password.
  3. Change SECRET_KEY in invenio.cfg.
  4. Run the command invenio instance migrate-secret-key --old-key CHANGE_ME.
  5. Attempt to log in with a user account using username and password.
  6. Encounter "incorrect password" error.

Expected behavior

Users should be able to log in with their credentials after the secret key migration, and the process should validate the old-key properly to ensure secrets are regenerated with the new secret key securely.

Additional context

The issue was discovered during testing of the migrate-secret-key command, raising concerns about the command's validation of the old-key parameter and the regeneration process of secrets.

@Samk13
Copy link
Member Author

Samk13 commented Mar 25, 2024

After discussions on the Discord maintainers channel:

  • We must add validation for the old secret to prevent the risk of entirely corrupting the stored values.
  • For the username/password method, here's Slint response on Discord

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