test(webauthn): exercise the attestation formats against real conformance statements - #254
Open
Bccorb wants to merge 1 commit into
Open
test(webauthn): exercise the attestation formats against real conformance statements#254Bccorb wants to merge 1 commit into
Bccorb wants to merge 1 commit into
Conversation
…ance statements Registration attestation was wired up in #168 and #169, but no test drove the individual statement formats. Hand-rolling one is close to reimplementing the authenticator, so these statements were captured from a FIDO2 conformance run and committed as fixtures. Packed, TPM and fido-u2f each verify end to end through the same call the WebAuthn controller makes, reporting the format and the model they came from. Each is then refused twice over, once with the attestation signature altered and once with the authenticator data altered. Android Key is covered alongside them because it proves the vendor root handling from #253: it is refused against the real Google roots and verifies once the preset roots are cleared, which is what conformance mode does. The metadata-absent path is covered in both requireKnownAuthenticator postures, offline. Passing no MDS servers and no statements makes the fixture's model unlisted by construction rather than by network luck, so strict refuses it and permissive registers it with no statement. Android SafetyNet is left as a todo with the reasoning recorded next to it. The conformance tools never emit one, and the verifier refuses any statement more than sixty seconds old, so a committed fixture could only pass against a faked clock. One thing worth stating, since it looks like a bug and is not: fido-u2f signs an explicit list of fields rather than the authenticator data as a whole, and the signature counter is not among them, so altering the counter verifies happily. The RP ID hash is altered instead.
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.
Addresses #210. Does not close it: the Android SafetyNet criterion cannot be met
as written, see below.
#168 and #169 wired up attestation and the metadata service, but nothing drove
the individual statement formats. Hand-rolling a statement is close to
reimplementing the authenticator, so these were captured from a FIDO2
conformance run and committed as fixtures under
tests/fixtures/attestation/.They replay offline, with no network and no metadata blob.
What is covered
Packed, TPM and fido-u2f each verify end to end through the same
verifyRegistrationResponsecall the WebAuthn controller makes, with the sameSUPPORTED_ALGORITHM_IDS, and each reports the format and AAGUID it came from.Each is then refused twice: once with the attestation signature altered, which
fails the signature check, and once with the authenticator data altered, which
fails the relying party check.
Android Key rides along because it pins the vendor root behaviour from #253. It
is refused against the real Google roots and verifies once the preset roots are
cleared, which is exactly what conformance mode does.
The metadata-absent path is covered in both
requireKnownAuthenticatorpostures. Initializing the metadata service with no MDS servers and no
statements makes the fixture's model unlisted by construction rather than by
network luck, so
strictrefuses it andpermissiveregisters it with nostatement.
Android SafetyNet, and why it is a todo
Two independent reasons, either of which is enough:
test group selected, produced no SafetyNet statement at all across 347
captured requests, though its metadata statement loads with the other 24.
Google turned down the SafetyNet Attestation API in favour of Play Integrity,
which is the likely reason it has left the server test suite.
statement more than sixty seconds after the authenticator produced it, so a
committed fixture is dead on arrival and could only pass against a faked
clock, which proves nothing about the format.
Left as
it.todowith the reasoning recorded beside it, rather than quietlydropped. #210's acceptance needs amending, which is a call for the repo owner,
so this PR deliberately does not close it.
One thing worth knowing
fido-u2fsigns an explicit list of fields rather than the authenticator dataas a whole, and the signature counter is not on that list, so altering the
counter verifies happily. That looks like a bug and is not. The RP ID hash is
altered instead, and the comment in the test says why.
Checks
Full suite green: 1232 passed, 1 skipped, 1 todo. Lint, typecheck, format and
coverage thresholds all clean. No changeset, matching how test-only changes have
landed here before.