mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-09 09:13:02 +03:00
[PR #6190] [MERGED] Fix Webauthn/Passkey 2FA migration/validation issues #2445
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?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/6190
Author: @BlackDex
Created: 8/16/2025
Status: ✅ Merged
Merged: 8/25/2025
Merged by: @dani-garcia
Base:
main← Head:webauthn-fixes📝 Commits (3)
c9070cfApply Passkey fixes from zUnixornd2632a3Fix Webauthn/Passkey 2FA migration issues5d0ade4Fix comments📊 Changes
2 files changed (+114 additions, -17 deletions)
View changed files
📝
Cargo.toml(+1 -2)📝
src/api/core/two_factor/webauthn.rs(+113 -15)📄 Description
Fix Webauthn/Passkey 2FA migration issues
Because the webauthn-rs v0.3 crate did not know or store new flags currently used in v0.5, some verifications failed.
This mainly failed because of a check if a key was backuped or not, and if it was allowed to do so.
Most hardware keys like YubiKey's do not have this flag enabled and can't be duplicated or faked via software.
Since the rise of Passkey's, like Bitwarden's own implementation, and other platforms like Android, and Apple use Software keys which are shared between devices, they set these backup flags to true. This broke the login attempts, because the default during the migration was
false, and cause an error during validation.This PR checks for the flags during the response/verification step, and if these flags are
true, then search for the stored key, adjust it's value, and also update the current challenge state to match, to prevent the first login attempt to fail.This should not cause any issue, since the credential-id is checked and matched, and only updated when needed.
Fixes #6154
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.