question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

verifyRegistrationResponse fails if not metadata was found

See original GitHub issue

When trying to register the an authenticator using fingerprint on my Pixel 3a I get

 Error: No metadata statement found for aaguid "b93fd961-f2e6-462f-b122-82002247de78"

Looks like MetadataService.getStatement always throws if no meta data was found: https://github.com/MasterKale/SimpleWebAuthn/blob/master/packages/server/src/services/metadataService.ts#L138

Is this intentional? Because then this code block doesn’t really make sense: https://github.com/MasterKale/SimpleWebAuthn/blob/master/packages/server/src/registration/verifications/verifyAndroidSafetyNet.ts#L94-L110

My guess is that getStatement should probably just return null if no metadata was found for a given aaguid, no?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MasterKalecommented, Sep 1, 2021

How about a verificationMode enum / union-type string instead?

Good call, I’d considered this earlier but was still indecisive on what exactly I needed to change about MetadataService to make things more permissive. A boolean seemed the simplest, but then I remembered that that’s what led to there being a requireResidentKey: boolean and “residentKey: ResidentKeyRequirement + instructions on what to set requireResidentKey to for a given residentKey” in L2 of the WebAuthn spec (because in L1 it made sense for resident key requirement to be a simple yes/no!)

I settled on this:

// Allow MetadataService to accommodate unregistered AAGUIDs ("permissive"), or only allow
// registered AAGUIDs ("strict"). Currently primarily impacts how `getStatement()` operates
type VerificationMode = 'permissive' | 'strict';

An optional verificationMode can be set when calling MetadataService.initialize(opts); to control how the service behaves. It will default to "strict" because that’s how MetadataService currently operates and I don’t want this to be a breaking change.

1reaction
MaKleSoftcommented, Sep 1, 2021

How about a verificationMode enum / union-type string instead? Something like

export type VerificationMode = "none" | "default" | "strict";

? Using verificationMode: "none" would be helpful for the use-case I described earlier where someone wants to fetch metadata only for logging or display purposes. Not sure what to call the “middle tier”. Maybe something more descriptive like fallback? Or perhaps you can come up with even more options for the verification behaviour 😃 That’s the nice things about using an enum instead of a boolean - it leaves you the option of adding additional modes in the future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A handful of server errors coming from Windows devices #238
This error is actually returned from the method that attempts to verify parts of the attestation statement against matching metadata. The fact ...
Read more >
No metadata for "BusinessApplication" was found - Stack ...
The problem. For me, this was happening after the webpack hot-reload because when everything was reloaded, new entity models were generated.
Read more >
Server - SimpleWebAuthn
Once MetadataService is initialized, verifyRegistrationResponse() will reference MDS metadata statements and error out if it receives authenticator responses ...
Read more >
entitymetadatanotfound no metadata for was found - You.com
js' ] Now the api is not started, getting this error error: [app] Application is crashed: EntityMetadataNotFound: No metadata for "User" was found....
Read more >
TypeORM - No metadata for "User" was found. - Reddit
Hoping some typeORM experts can help me out, burned wayyy to much time on this. Was wondering if anyone can shed some light...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found