mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-06 09:13:19 +03:00
🐛 Bug Report: Shared passkey between KeePassXC and Keepassium does not work #269
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 @Bastian on GitHub.
Reproduction steps
Expected behavior
Sharing a passkey between desktop and mobile should work
Actual Behavior
When I add a passkey on my desktop with KeePassXC (Linux with the Firefox extension) and then try to use the stored passkey on my mobile device with Keepassium (iOS), I cannot authenticate and get the error message "Something went wrong" in the web UI. The error "BackupEligible flag inconsistency detected during login validation" is logged in the server logs.
The same thing happens in reverse: if I create the passkey on my mobile device and then try to use it on the desktop, the same error occurs.
When I use the passkey on the device it was created on, everything works as expected.
I'm not entirely sure which application is misbehaving here, especially since passkey support in Keepassium is still fairly new. However, on other websites (e.g. Amazon), sharing a passkey between Keepassium and KeepassXC works without any problems.
I have also tried the Pocket ID Demo and have the same problem here. So I can at least rule out that it is a problem with my Pocket ID deployment.
Version and Environment
Pocket-ID: v0.44.0
KeePassXC 2.7.0
Keepassium v2.3.163 Pro
Log Output
@Bastian commented on GitHub:
The same happens when creating the passkey in Keepassium and trying to use it in KeepassXC. I might be wrong, but the information about what flags were used during creation is not stored in the Keepass database, is it? So either application is currently not able to behave correctly when sharing passkeys.
@stonith404 commented on GitHub:
I'm 99% sure that this is a bug of KeePassXC.
It seems like that in the code of Keepassium the "BackupEligible" gets set to
trueand in the code of KeePassXC gets set tofalse. I have no experiencing in creating Webauthn credentials though, I might also be wrong.Since this issue has not been reported with any other passkey provider, I am closing it because it is very likely not related to Pocket ID.
@kmendell commented on GitHub:
This is interesting, I share my passkeys in Bitwarden and i have no issues, im wondering if this is a KeePassXC issue?
@droidmonkey commented on GitHub:
Since the key was created in keepassxc then we technically get say over backup eligibility per the spec. Keepassium would be the misbehaving app in the scenario described.
However, the real problem is that we are both using hardcoded values for backup eligibility and implemented those values differently.
I read the spec on this, is it within spec to reject authentication because of a BE mismatch? Despite its strong wording on not changing the value, it is a non-cryptographically, authenticator reported setting that really means nothing for the authentication ceremony.
https://www.w3.org/TR/webauthn-3/#sctn-credential-backup
The spec gives example of what to do with this flag and that does not include rejection on stored mismatch.
@Bastian commented on GitHub:
Thank you for investigating the problem and pointing me in the right direction! I'll experiment with some other clients, and if I can pinpoint the problem back to KeePassXC, I'll open an issue there.
@stonith404 commented on GitHub:
@droidmonkey Thanks for your comment. To be honest I'm not an expert in Webauthn and I haven't read the spec. We are using go-webauthn for passkey authentication and this library returns an error if the backup eligibility mismatches.
The author has mentioned that the spec defines that credentials should get rejected if the flag mismatches. I skimmed the spec and I didn't find that credentials should get rejected if the flag mismatched but the author of this library is probably an expert in Webauthn so I don't want to contradict him. If you think that rejecting the credential is wrong, I could create an issue in go-webauthn.
@droidmonkey commented on GitHub:
That language still does not say to reject authentication. It supports my opinion of an option within relying party implementations to decide whether or not to issue a "warning" or to be more strict and reject the authentication. If go-webauthn does not give this option, then I think that is a missing feature.
@droidmonkey commented on GitHub:
I personally don't think it is appropriate to reject authentication since that is not explicitly required in the spec. At least not in the sections regarding backup enablement.
I do think a warning should be issued, and a toggle flag for "strictness" be available to better control the desired outcome/behavior.
@droidmonkey commented on GitHub:
That is correct the information is not stored or read even if it was stored. Not saying we don't need to fix something 😁
@Bastian commented on GitHub:
I have found the relevant part of the spec that clearly states that the BE flag should be verified:
(7.2. Verifying an Authentication Assertion)
It was introduced in PR https://github.com/w3c/webauthn/pull/1907 as a response to issue https://github.com/w3c/webauthn/issues/1791.
@Bastian commented on GitHub:
The only exception when verification is not required is if the backup state is not part of the RP’s business logic or policy.
Looking at the discussion in the PR, the intention for this exception seems to be that the RPs are not required to store the initial value, and thus might not be able to enforce it.
See https://github.com/w3c/webauthn/pull/1907#discussion_r1233918349: