mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-01 11:19:52 +03:00
Admin reset not working #1545
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @R-DGS on GitHub (Mar 29, 2023).
Subject of the issue
Enabled admin reset for a organization. Master-password reset.
i used it on a test user to test it how how it works etc and if it works.
When i reset the password and try to login with that account it just fails the login says username / password wrong.
i tried to change the password multiple times but the same Error.
Deployment environment
@BlackDex commented on GitHub (Mar 29, 2023):
Seems to work fine for me.
Are there any errors in the logs or the browser F12 console when resetting the password?
@R-DGS commented on GitHub (Mar 29, 2023):
/identity/connect/token 400 (Bad Request)
{
"ErrorModel": {
"Message": "Username or password is incorrect. Try again",
"Object": "error"
},
"ExceptionMessage": null,
"ExceptionStackTrace": null,
"InnerExceptionMessage": null,
"Message": "Username or password is incorrect. Try again",
"Object": "error",
"ValidationErrors": {
"": [
"Username or password is incorrect. Try again"
]
},
"error": "",
"error_description": ""
}
@BlackDex commented on GitHub (Mar 29, 2023):
I actually mean during the password reset, not during login.
Also, what happens if you try to use the original password, and not the one used to reset?
@R-DGS commented on GitHub (Mar 29, 2023):
the account that i did restart was an account that already excists before this update to the latest version. I enabled rest master password and reset it. The old one and new one arnt working.
I just created a new account and added it to the same organization. and this one is auto added to the enrollment. and i also did a reset on this account but for this one it works.
I tried it again on the old one and it does not work.
@stefan0xC commented on GitHub (Mar 29, 2023):
Can you tell us more? E.g. by posting the generated support string of the diagnostics page in the admin panel? And by also providing the logs when you try to change the password of the old user if there might be some indication what happens?
@BlackDex commented on GitHub (Mar 29, 2023):
I just tried multiple scenarios, including the one you did with an existing account.
I'm not seeing any issues here at all.
From which version did you come?
@R-DGS commented on GitHub (Mar 29, 2023):
Your environment (Generated via diagnostics page)
Config (Generated via diagnostics page)
Show Running Config
Environment settings which are overridden: ADMIN_TOKEN
_vaultwarden_logs.txt
@R-DGS commented on GitHub (Mar 29, 2023):
1.27 the previous version
@BlackDex commented on GitHub (Mar 29, 2023):
First, i would suggest to try and use a reverse proxy to handle the TLS/Cert errors I see.
Second, could you please try the
:testingtagged image and see if that solves the issue?I see an error regarding the
known deviceendpoint. While i think it shouldn't have any impact, i could be wrong of course.@R-DGS commented on GitHub (Mar 29, 2023):
This is a live setup. so i cant really just put the whole vaultwarden on testing.
This is only for internal usage. a reverse proxy in our network is harder to fix.
@BlackDex commented on GitHub (Mar 29, 2023):
Well. there is nothing changed in testing except that issues.
You can always copy the database etc.. and setup a different container maybe?
@R-DGS commented on GitHub (Mar 29, 2023):
will check on that. Because this is a VM with debian /docker installed. need to move the VM it self to a different system.
@BlackDex commented on GitHub (Mar 29, 2023):
I think i have found the issue.
@BlackDex commented on GitHub (Mar 29, 2023):
Yes. The issue is that for some reason the mail which needs to be sent to the user isn't sent, which causes a delay/timeout and causes a 504 for me at least. And for some reason it breaks the reset. Which is strange, since it should break/exit/return if sending the mail doesn't work, and should not reset the users password at that point.
@BlackDex commented on GitHub (Mar 29, 2023):
@R-DGS Can you verify that that specific account did not receive a mail about the password reset?
@R-DGS commented on GitHub (Mar 29, 2023):
When i reset the password i get a email saying that the master password is reset.
@BlackDex commented on GitHub (Mar 29, 2023):
Hmm... Also for the user for which it is not working?
@R-DGS commented on GitHub (Mar 29, 2023):
Yes. Every time i do a reset i get an email.
@BlackDex commented on GitHub (Mar 29, 2023):
Could you try to login with a different browser or in an Private/Incognito mode for that user?
I'm a bit confused. Since if the submit works it should have set the correct password.
@R-DGS commented on GitHub (Mar 29, 2023):
I have tried it in firefox / firefox private chrome / chrome private
i did start up a old copy of the VM and updated that one also. As far as i know not much is changed except in the other one is all users and passwords and different org and the one 1 started is a initiele setup of vaultwarden.
on my test copy which is running the latest nog the testing it is working on the old account that is there.
Maybe due to al the testing and changing it might have corrupted that user account.
So maybe i will see if i can maybe a copy of the live version and do some tests with that one.
@BlackDex commented on GitHub (Mar 29, 2023):
In theory, you should be able to overwrite the users record which includes they key's and hashed master-password-hash.
That way the users password and key still match and if the password/keys are not rotated it should still be able to access it.
Just make sure to make a backup of the database.
Also. you could try to do a database check.
If that results in all ok, a database corruption is probably not the issue.
@R-DGS commented on GitHub (Mar 29, 2023):
it did give the status ok
@R-DGS commented on GitHub (Mar 29, 2023):
What i do remember and i was looking in the sqlite db. that on the account where i reset the admin password i had changed the Keys to Argon2id.
Standard that isnt used yet but also wanted to test that out on that account.
I tried it again with a new account and changed the keys to Argon2ID and change the master password and now it fails again.
On the account where i changed this does not have this argon2ID yet chosen.
@BlackDex commented on GitHub (Mar 29, 2023):
Ai. We need to check if this also happens on Bitwarden it self! If that is the case, we can't fix this our self.
But good find! Thanks for the update.
@BlackDex commented on GitHub (Mar 29, 2023):
I Quickly tried this my self. And I do not see the same issue unfortunately
@stefan0xC commented on GitHub (Mar 30, 2023):
I managed to reproduce this by setting the
Argon2idparameters really high so it takes a lot more than a second (something likem=512,t=6,p=4).Adding my test account to the organization and enrolling to the feature worked. But when I tried to change the password via the admin password reset function, I could not login with this account anymore (neither old nor new password).
I could get the login for my test account working by manually reducing these values directly in the database and then resetting the password again:
Not sure if this has any unintended side consequences (so far it looks good but I have not tested this extensively).
edit: updated to the actual sql statement I ran...
@BlackDex commented on GitHub (Mar 30, 2023):
That kinda looks the same as my mail timeout issue i just got once.
Does the call to the server get executed? Or does something else happens?
Is this more a client side issue or server? And what happens when you use the PR i created with the error fix?
@stefan0xC commented on GitHub (Mar 30, 2023):
I got a mail network issue (once), my firefox also froze by the second time (but might have been unrelated) and once it looked like it worked (but without any error messages).
I will test your PR tomorrow (sorry, it's getting late). But if the client can't handle it, then it might be out of our control.
@BlackDex commented on GitHub (Mar 30, 2023):
But, it shouldn't break, or render the login invalid. Unless the argon2 code part freezes and breaks for some reason. But the data in the db should still be valid. We only store the new key/pw-hash.
@R-DGS commented on GitHub (Mar 30, 2023):
Yes i also had it set a little higher than the standard 128 5 7 or 7 5 for the last 2 values.
@stefan0xC commented on GitHub (Mar 30, 2023):
I think I found the problem in
reset-password-detailsbecause it only returns a value forKdfandKdfIterations. So my sql statement should actually have set the remaining values to the default values (m=64 p=4) to get the password to work. Sorry I had changed it to lower values in my previous post but not actually tested it. 😓@BlackDex commented on GitHub (Mar 30, 2023):
Ah!. I did not changed anything, and used the default settings. Which is probably what will be used if nothing is returned.
I'm Quickly testing this right now :)
@BlackDex commented on GitHub (Mar 30, 2023):
@stefan0xC Yes, it looks like it just used the defaults set for Argon2id. That is why it worked for me in my test.
Ill update my PR to fix this
@BlackDex commented on GitHub (Mar 30, 2023):
Thanks @R-DGS for reporting this issue. There is a PR now which should fix this.
Thanks @stefan0xC for spotting the specific location!
I checked all other locations where we return these values, and looks like all should be valid and this location was missed.
I added you as Co-Author to the PR :).