fix(webauthn): format AAGUID as canonical UUID and guard missing clientExtensionResults - #139
Closed
rootkiller6788 wants to merge 3 commits into
Closed
Conversation
The character class [a-zA-z] is a typo: the A-z range spans ASCII 65-122, which inadvertently includes [, \, ], ^, _ and ` between 'Z' and 'a'. App names extracted from the User-Agent should only match [a-zA-Z0-9_.].
</mwc-textfieldtype=> is an invalid closing tag (the tokenizer consumes '=' into the tag name), leaving the mwc-textfield element unclosed and producing an HTML parse error. Close it properly with </mwc-textfield>.
…ntExtensionResults - parseAuthData(): the splice groups produced an 8-4-4-16 AAGUID string instead of the canonical 8-4-4-4-12 UUID layout (a missing hyphen grouping). This made the AAGUID shown in the payload analyzer malformed. - listCredentials(): the two credential-properties lines accessed extensions.credProps without guarding extensions, while the adjacent line uses extensions?.credProps. Credentials stored without clientExtensionResults made the whole list rendering throw.
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.
Summary
Four small, independently verifiable bugs fixed in the WebAuthn demo:
AAGUID formatted as malformed UUID (
src/public/scripts/main.ts,parseAuthData)The
splicegroups produced an 8-4-4-16 string instead of the canonical 8-4-4-4-12 UUID layout, so the AAGUID shown in the payload analyzer was missing a hyphen grouping.Crash rendering the credential list when
clientExtensionResultsis missing (src/public/scripts/main.ts,listCredentials)Two of the three credential-properties lines accessed
extensions.credProps?.rk/extensions.credProps?.authenticatorDisplayNamewithout guardingextensions, while the adjacent line usesextensions?.credProps. Credentials stored withoutclientExtensionResults(the field is optional onStoredCredential) made the entire list rendering throw and show 'Loading credentials failed.'Malformed closing tag in the Picture URL textfield (
src/templates/index.html)</mwc-textfieldtype=>is not a valid closing tag; the HTML tokenizer consumes=into the tag name, leaving the element unclosed and emitting a parse error. Closed correctly with</mwc-textfield>.Android app-name regex character-class typo (
src/libs/webauthn.mts,getOrigin)[a-zA-z]spans ASCII 65-122 (theA-zrange), unintentionally including the characters betweenZanda. Should be[a-zA-Z0-9_.].Verification
npm run build(rollup +tsc) passes cleanly on the branch.