Skip to content

fix(ctap2): preserve raw authenticatorData bytes#249

Merged
AlfioEmanueleFresta merged 1 commit into
masterfrom
fix/authdata-byte-preservation
Jun 7, 2026
Merged

fix(ctap2): preserve raw authenticatorData bytes#249
AlfioEmanueleFresta merged 1 commit into
masterfrom
fix/authdata-byte-preservation

Conversation

@AlfioEmanueleFresta

Copy link
Copy Markdown
Member

The client rebuilt the authenticator data from a parsed structure instead of keeping the exact bytes the authenticator produced. An authenticator signature covers those exact bytes, so re-encoding could drop extension entries the client did not model or reorder map keys, which would make a relying party reject an otherwise-valid signature. This was confirmed against a real device response carrying an extension the client did not model.

This keeps the authenticator data verbatim and returns it unchanged. Platform-synthesized data is still built from fields.

Includes a regression test confirming the bytes round-trip unchanged, including an unmodeled extension.

@AlfioEmanueleFresta AlfioEmanueleFresta marked this pull request as ready for review June 7, 2026 15:07
The authenticator signs over the exact authData bytes, including the
extensions block. Rebuilding authData from the parsed struct could drop
unmodeled extensions or reorder keys, breaking the relying party's
signature verification. Keep the device bytes and return them unchanged.
Platform-synthesized U2F authData still rebuilds from the fields.
@AlfioEmanueleFresta AlfioEmanueleFresta force-pushed the fix/authdata-byte-preservation branch from 89bb140 to 97eaaf2 Compare June 7, 2026 15:48
@AlfioEmanueleFresta AlfioEmanueleFresta merged commit 14afd1f into master Jun 7, 2026
5 checks passed
@AlfioEmanueleFresta AlfioEmanueleFresta deleted the fix/authdata-byte-preservation branch June 7, 2026 15:48
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