Repository navigation
Verify BS flag not set when BE is unset - #516
Merged
Merged
Conversation
WebAuthn Level 3 requires the relying party to verify that the BS bit is not set when the BE bit is not set, in both the registration and authentication ceremonies. A credential that is not backup eligible cannot be backed up, so this combination is invalid. Verification now raises `WebAuthn::BackupFlagsVerificationError` for it. `FakeClient#get` defaulted to BE=0/BS=1, which this check rejects. Its `backup_state` default is now `false`. https://www.w3.org/TR/webauthn-3/#sctn-registering-a-new-credential https://www.w3.org/TR/webauthn-3/#sctn-verifying-assertion
santiagorodriguez96
force-pushed
the
sr--verify-backup-flags
branch
from
October 22, 2026 18:22
88356ba to
ab3c419
Compare
nicolastemciuc
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
WebAuthn L3 requires rejecting authenticator data whose backup flags are internally inconsistent. Step 17 and 18 (respectively) of both RP ceremonies (§7.1, §7.2):
A credential that is not backup-eligible cannot currently be backed up, so
BE=0/BS=1is a structurally impossible combination. We parse both flags (authenticator_data.rb:23-24) but never check them against each other, so such authenticator data verifies successfully today.Details
This PR adds a verification step to
WebAuthn::AuthenticatorResponseso that registration and authentication now reject authenticator data that has the BS (backup state) flag set without the BE (backup eligibility) flag.It also changes
FakeClient#getdefault for:backup_stateas it defaulted tobackup_eligibility: false,backup_state: true, which is the invalid combination.