mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
U2F registration returns NotTrustedAnchor #144
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 @Jellyfrog on GitHub (Nov 29, 2018).
When registering an U2F key (Yubikey) server fails with
Error: NotTrustedAnchor, which seems to come from here:193de35093/src/register.rs (L50)At first I thought it was the reverse proxy, but same result using it directly with Rocket.
bitwarden_rs @ 0f6ab01f777700c68aee8fcf0cbf0be742c286e1
web-vault @ v2.5.0
FreeBSD 11.2-RELEASE-p5
Config
Log:
PUT request returns:
@Jellyfrog commented on GitHub (Nov 29, 2018):
This is probably due to broken certs in the key;
https://github.com/briansmith/webpki/pull/34#issuecomment-273727506
https://github.com/tstranex/u2f/issues/8#issuecomment-366842256
Will try to verify if this is the case.
@dani-garcia commented on GitHub (Jan 22, 2019):
Seeing as this is a problem for more people, I'm looking into a possible solution. Checking the other libraries that already deal with this issue, I published a new branch that should hopefully detect it (but not fix it, for now):
https://github.com/dani-garcia/bitwarden_rs/tree/trustanchor-fix
Running this should print in the console something like:
And if it detected the cert as one of the broken ones, it would also print
Detected broken cert, fixing...(It won't fix anything yet, I want to make sure this is the right way first).@mprasil Can you get a docker image built, so those using docker can test this issue?
@neoautomata, @Jellyfrog can you check this branch and see if it detects the issue?
@Jellyfrog commented on GitHub (Jan 22, 2019):
Weirdest thing, I can now register my key.
Will try later on my other laptop where it didn't work...
@mprasil commented on GitHub (Jan 22, 2019):
The image is just being built, give it about an hour and then you can use
mprasil/bitwarden:trustanchor-fixto test it.@neoautomata commented on GitHub (Jan 22, 2019):
Using that Image I get the following in the server logs:
@neoautomata commented on GitHub (Jan 22, 2019):
My other key has a different hash:
@Jellyfrog commented on GitHub (Jan 23, 2019):
Same key, different computer:
@Jellyfrog commented on GitHub (Jan 24, 2019):
With Firefox it always works for me, and it returns the same cert each time:
With Chrome it returns different data each time and never works;
Note the different cert length also.
@dani-garcia commented on GitHub (Jan 25, 2019):
This should have been fixed now in
9d027b96d8, hopefully.@neoautomata commented on GitHub (Jan 25, 2019):
Just pulled down
:latestand I was able to register one of my keys, but not the other. I think it's the second hash above which didn't work. It does work on Github, so I don't think it's the key.@dani-garcia commented on GitHub (Jan 26, 2019):
Do you still get the NotTrustedAnchor error, or is it something different this time?
@neoautomata commented on GitHub (Jan 26, 2019):
Yes, same NotTrustedAnchor error. I also got a pop up from chrome asking to read make and model of the key, which I've never seen on any site before.
@dani-garcia commented on GitHub (Jan 26, 2019):
The popup is expected, it's to avoid Chrome from sending us self-signed certificates instead of the devices actual certificate.
Can you tell me what do you get now running the
:trustanchor-fiximage with both keys? (Make sure to pull it to use the newest one)@neoautomata commented on GitHub (Feb 3, 2019):
Sorry it has taken me a bit to respond, was out of town.
Here's the error from the lastest
trustanchor-fiximage:@dani-garcia commented on GitHub (Feb 3, 2019):
Okay, with some more testing using that cert, I found the cause of the problem, the cert doesn't have an extensions field with a SubjectAltName, and webpki requires it, there is a recent bug about it here: https://github.com/briansmith/webpki/issues/90. This makes sense for SSL certificates, which is what the library was made for, but apparently some U2F devices don't have those required values.
There is a pending issue for U2F attestation support that mentions that change, but it hasn't seen activity in a while: https://github.com/briansmith/webpki/issues/57.
I'm not sure there is something we can do here for now, and I don't think it would be particularly safe for us to try to add a random SubjectAltName whenever we get an error.
@yacoob commented on GitHub (Jun 9, 2019):
Just bumped into this. The weirdest thing is, I've only seen this upon trying to add a second key to my account - which is weird, as I somehow was able to add the first one :D
Just to make sure I get the whole picture: does this effectively preclude usage of fido u2f until the referenced bugs are resolved?