Skip to content

fix(webauthn): format AAGUID as canonical UUID and guard missing clientExtensionResults - #139

Closed
rootkiller6788 wants to merge 3 commits into
google:mainfrom
rootkiller6788:fix-client-display-and-typo-bugs
Closed

fix(webauthn): format AAGUID as canonical UUID and guard missing clientExtensionResults#139
rootkiller6788 wants to merge 3 commits into
google:mainfrom
rootkiller6788:fix-client-display-and-typo-bugs

Conversation

@rootkiller6788

Copy link
Copy Markdown

Summary

Four small, independently verifiable bugs fixed in the WebAuthn demo:

  1. AAGUID formatted as malformed UUID (src/public/scripts/main.ts, parseAuthData)
    The splice groups 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.

  2. Crash rendering the credential list when clientExtensionResults is missing (src/public/scripts/main.ts, listCredentials)
    Two of the three credential-properties lines accessed extensions.credProps?.rk / extensions.credProps?.authenticatorDisplayName without guarding extensions, while the adjacent line uses extensions?.credProps. Credentials stored without clientExtensionResults (the field is optional on StoredCredential) made the entire list rendering throw and show 'Loading credentials failed.'

  3. 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>.

  4. Android app-name regex character-class typo (src/libs/webauthn.mts, getOrigin)
    [a-zA-z] spans ASCII 65-122 (the A-z range), unintentionally including the characters between Z and a. Should be [a-zA-Z0-9_.].

Verification

  • npm run build (rollup + tsc) passes cleanly on the branch.
  • AAGUID change verified to produce a canonical 36-char 8-4-4-4-12 UUID vs the previous 8-4-4-16 form.

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.
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.

1 participant