mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-11 17:41:29 -05:00
Webauthn security key results in Can't recover login challenge #4714
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 @assid2 on GitHub (Jul 6, 2021).
Subject of the issue
Webauthn does not work
Deployment environment
Your environment (Generated via diagnostics page)
Config (Generated via diagnostics page)
Show Running Config
Environment settings which are overridden: DOMAIN, SIGNUPS_ALLOWED, ADMIN_TOKEN, YUBICO_CLIENT_ID, YUBICO_SECRET_KEY, SMTP_HOST, SMTP_SSL, SMTP_PORT, SMTP_FROM, SMTP_USERNAME, SMTP_PASSWORD
Steps to reproduce
Use a registered yubikey to login to your account,
Expected behaviour
Authentication module should verify the key
Actual behaviour
Received error : Can't recover login challenge
Troubleshooting data
[2021-07-06 04:43:55.913][error][ERROR] 2FA token not provided
[2021-07-06 04:44:05.146][error][ERROR] Webauthn.
[CAUSE] UserNotVerified
[2021-07-06 04:44:07.259][vaultwarden::api::core::two_factor::webauthn][ERROR] Can't recover login challenge
@BlackDex commented on GitHub (Jul 7, 2021):
I think i know where the issue is.
3968bc8016/src/db/models/two_factor.rs (L200)The only thing i do not know is what will happen if we set that to true and what implication it could have.
Does the token you use has any special User Verification capabilities?
@dani-garcia do you know if we can just change that value to true without any issues?
@dani-garcia commented on GitHub (Jul 7, 2021):
Setting that value to true will enforce that the client is setting the user_verified flag when authenticating, setting it to false would disable the check instead, so if anything, using false would be the more compatible option.
This is where the check is being done, the only thing I can think of is that the client is setting the UserVerificationPolicy to required but not setting the user_verified flag?
02a99f5341/src/core.rs (L635-L652)It would help to know which security key and which browser or client is causing the problem.
@sehraf commented on GitHub (Jul 7, 2021):
NitroKey FIDO2 + Chrome WebUI
NitroKey FIDO2 + Chrome Browser Extension
YubiKey 4 + Chrome WebUI
Both sticks don't work anymore
@assid2 commented on GitHub (Jul 7, 2021):
I tried this on Yubikey 5NFC on both Firefox and Chrome.
@techsolo12 commented on GitHub (Jul 10, 2021):
I have this error with Yubikey 5C and 5 NFC on Firefox Desktop and Firefox and Chrome mobile Android.
For me the error came after i add a new key. The older ones which are migrated from FIDO works.
@mr-kek commented on GitHub (Jul 10, 2021):
Having the same issue.
Yubikey 5 HFC, Yubikey 5c NFC, Yubikey 5Ci NFC.
I'm on macOS using Safari.
Safari Web extension also has a problem with WebAuthn, works fine with touchid set as WebAuthn
Also tried with Chrome, same problem.
1st login, just says Error, WebAuthn, second login attempt give Error, Can't recover login challenge.
I can confirm that using touch id WebAuthn on safari to log in works, which is nice.
I can use the Yubikey's with the normal Yubikey OTP, but really want WebAuthn working. It hasn't worked for me at all with any version. I just upgraded to the latest vault warden, and I can't remember the error I got before, but now I get the same error as the OP.
@tars-mistaike commented on GitHub (Jul 12, 2021):
+1 I have this issue on Safari and Chrome with Solokey. TouchID does indeed work, though if you delete and recreate TouchID you have to give it a different name in Vaultwarden. Reusing breaks it.
FaceID also works if you log into the web on the iPhone, which is cool.
@BlackDex commented on GitHub (Jul 14, 2021):
@assid2, have you tried yet to name the keys something with some gibberish name? And see if that solves it?
@coalfield commented on GitHub (Jul 14, 2021):
+1 same issue with a similar synology docker setup, they key itself adds in fine but when logging in it fails. Using Yubikey Nano 5. Noticed I am getting UserNotVerified too?
@coalfield commented on GitHub (Jul 14, 2021):
So after playing around with some of the config, this is miraculously is now working. At first I removed all the WebAuth keys, then added a gibberish name as @BlackDex suggested, and it worked. Then removed again and called it Nano 5 and that's also now working. Not sure if its linked or fluke. Of note I am still getting this (and only this) on the log:
[error][ERROR] 2FA token not provided@BlackDex commented on GitHub (Jul 15, 2021):
Ok, good to know. It could be that there is something within the cache which is causing this somehow. Not sure. But @assid2, if you could test this too that would be great.
@coalfield that message is normal during first login if I'm correct.
Nothing to worry about.
@mr-kek commented on GitHub (Jul 15, 2021):
I tried gibberish, and same problem for me. Still doesn't work
@coalfield commented on GitHub (Jul 15, 2021):
Does it pop up and ask for a pin even? As mine was not doing that when it was not working. Are you running on Synology by chance? If so can try to remember the changes I made prior to it fixing itself on config
@mr-kek commented on GitHub (Jul 15, 2021):
yes, running on a Synology, and yes it's asking for a pin every time.
@assid2 commented on GitHub (Jul 15, 2021):
Ok here is something I tried, (background info - i had reset my fido pin but shouldn't have any effect here)
@coalfield commented on GitHub (Jul 16, 2021):
Good to know. Not sure the reason for it... not liking seeing [error] in the logs :(
@szorlowski commented on GitHub (Jul 20, 2021):
Ok guys. I've got a same issue and I couldn't solve that BUT for me the issue occurs only on windows.
I've tried that on 3 machines with linux (mint20) and it worked well.
I tried to disable antivirus and firewall but it didn't help. Maybe that info may help with solving the issue
EDIT: vaultwarden hosted on raspberry pi. Windows and linuxes were clients.
Summary: all logins on windows were blocked - web, desktop. On linux every login passed
@coalfield commented on GitHub (Jul 20, 2021):
So with mine the pin Prompt never came up which is windows linked so it does make sense. Have a try removing and adding windows hello with the key. This means removing the pin code and re-adding it. This was definitely one of the things I did between getting the error and the error fixing itself
@szorlowski commented on GitHub (Jul 22, 2021):
Unfortunately that ⬆️ didn't help but to be honest I was not hoping to. I found very interesting thing. I can log in on windows but with different machine. So there must be an issue with my home windows10 configuration or network config within it.
IMPORTANT: on this 'broken' machine webauthn is working in bitwarden (official). It does not work only on self hosted vaultwarden. I think something somehow is blocking my custom domain but its only a guess
Still checking it and I will inform you guys when I found solution to it
UPDATE: It stopped working everywhere. I have no idea why...
@BlackDex commented on GitHub (Jul 25, 2021):
With some help from @assid2, i think i have fixed this issue. See the linked PR.
@sehraf commented on GitHub (Jul 27, 2021):
I still can't add my NitroKey again, getting the same webauthn error.
Is there anything more to do then updating to 1.22.2?
@BlackDex commented on GitHub (Jul 28, 2021):
@sehraf could you enable debug logging and provide the logs from during the key registration and login attempt using that key?
@mr-kek commented on GitHub (Jul 28, 2021):
Can confirm I'm all good now with the new version ((1.22.2). Web Auth all working on macOS in safari with both yubikey and Touch ID.
Very happy. Thanks :)
@sehraf commented on GitHub (Jul 28, 2021):
I found the error while collecting the logs:
Apparently i just had to remove the trailing
/from my domain environment entry. Now it works!