Locked out of vault, copy password hash directly in database

Hello everybody,

I am self hosting Vaultwarden. Today I changed my master password to one that vaultwarden extension (Firefox) generated. As soon as I changed it, i was logged out of the Firefox extension.

I wasn’t expecting that and of course, I then had no chance to know the very cryptic long password. I was also logged out of every Bitwarden App on my phone and tablet.

So, currently I don’t have access to my vault. There is no solution in the admin page.

Having access to the database I thought I could replace the password hash. I created a new temporary user with a password I know. I then opened the sqlite database and copied the password hash (table: users, field: pasword_hash) from the temporary user to my existing one.

Unfortunately the login is still not working. I don’t know that maybe still is missing. So I also tried to set field salt from the temporary user. Still without luck.

I still can login using the temporary user but not my main vault. Is there something else that I am missing or is it just not possible what I am trying to do?

Without an earlier backup from your database it’s probably not possible.

I was afraid of that.

But today I got extremely lucky when I opened my work notebook where I also have installed the Bitwarden extension in Firefox.

Yesterday, after messing inside the database without being able to change the password_hash successfully, I stopped the Vaultwarden docker container out of frustration. I didn’t think about the extension on my work notebook. Today I opened the extension and was able to login with my old password because the extension wasn’t able to sync with the server. I was able to export all my passwords to a JSON file.

@stefan0xC still thank you for clarification that it wouldn’t have worked anyway.

A happy ending but a warning to make regular backups. Since you are using docker it’s easy to add a docker based backup solution like the one I linked to in this post.