Skip to content

Verify BS flag not set when BE is unset - #516

Merged
santiagorodriguez96 merged 4 commits into
masterfrom
sr--verify-backup-flags
Oct 22, 2026
Merged

santiagorodriguez96 merged 4 commits into
masterfrom
sr--verify-backup-flags

Conversation

@santiagorodriguez96

Copy link
Copy Markdown
Contributor

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):

If the BE bit of the flags in authData is not set, verify that the BS bit is not set.

A credential that is not backup-eligible cannot currently be backed up, so BE=0/BS=1 is 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::AuthenticatorResponse so 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#get default for :backup_state as it defaulted to backup_eligibility: false, backup_state: true, which is the invalid combination.

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
santiagorodriguez96 merged commit 976d53a into master Oct 22, 2026
96 of 97 checks passed
@santiagorodriguez96
santiagorodriguez96 deleted the sr--verify-backup-flags branch October 22, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants