Skip to content

Fix decoding Attestation auth data with extentions#243

Merged
ottokruse merged 3 commits intoaws-samples:mainfrom
RobHarveyDev:fix-decoding-with-extentions
Apr 10, 2025
Merged

Fix decoding Attestation auth data with extentions#243
ottokruse merged 3 commits intoaws-samples:mainfrom
RobHarveyDev:fix-decoding-with-extentions

Conversation

@RobHarveyDev
Copy link
Contributor

@RobHarveyDev RobHarveyDev commented Apr 7, 2025

Issue #, if available:

This fixes an issue similar to this one: cedarcode/webauthn-ruby#107

Samsung passkeys seem to pass an extension

{
    "hmac_secret": true
}

which is causing the cbor decoder to fail as there's more data than expected.

The error we are seeing in AWS Cloudwatch is:
Unexpected data: 0xa1 at decodeFirstSync (file:///var/task/index.mjs:1830:19) at cborDecode (file:///var/task/index.mjs:4541:44) at decodeCredentialPublicKey

This change decodes all the data to prevent this, and then returns the first decoded object to replicate the existing returned data.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@RobHarveyDev RobHarveyDev changed the title Fix decoding with extentions Fix decoding Attestation auth data with extentions Apr 7, 2025
@ottokruse
Copy link
Contributor

So is this a bug in cbor or in our lib? Willing to accept your PR in either case, just curious

@RobHarveyDev
Copy link
Contributor Author

I think it's a bug in the library as it's not expecting any additional data, such as the extensions.

@ottokruse ottokruse merged commit 4a06c10 into aws-samples:main Apr 10, 2025
1 check passed
@ottokruse
Copy link
Contributor

Thx for the PR

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