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.

VerifyAsync accepts Fmt = "none" even when AttestationConveyancePreference was "direct"

See original GitHub issue

Method VerifyAsync from AuthenticatorAttestationResponse doesn’t check which Attestation was inside originalOptions. It uses an AttestationVerifier selected depending on what was in the request (AttestationObject.Fmt):

AttestationVerifier verifier = AttestationObject.Fmt switch
{
    // TODO: Better way to build these mappings?
    "none" => new None(),                           // https://www.w3.org/TR/webauthn/#none-attestation
    "tpm" => new Tpm(),                             // https://www.w3.org/TR/webauthn/#tpm-attestation
    "android-key" => new AndroidKey(),              // https://www.w3.org/TR/webauthn/#android-key-attestation
    "android-safetynet" => new AndroidSafetyNet(),  // https://www.w3.org/TR/webauthn/#android-safetynet-attestation
    "fido-u2f" => new FidoU2f(),                    // https://www.w3.org/TR/webauthn/#fido-u2f-attestation
    "packed" => new Packed(),                       // https://www.w3.org/TR/webauthn/#packed-attestation
    "apple" => new Apple(),                         // https://www.w3.org/TR/webauthn/#apple-anonymous-attestation
    _ => throw new Fido2VerificationException("Missing or unknown attestation type")
};

The problem with this is that if we requested attestation by returning “direct” as the AttestationConveyancePreference, then we are not checking that in that case AttestationObject.Fmt was different than “none”.

I’m right with my analysis or am I missing something?

Thanks for your time!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
aseiglercommented, Oct 20, 2022

The attStmt.fmt “none” has nothing to do with the options.attestation “none”. The RP in steps 3 - 21 checks the result to see if it matches spec and policy, if anything is amiss, the registration should be failed.

1reaction
aseiglercommented, Oct 21, 2022

Check out https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-attestationformats. It’s been made a bit more obvious in this draft of the next version of the spec.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Web Authentication: An API for accessing Public Key ...
Relying Parties use the attestation public key conveyed in the attestation certificate to verify the attestation signature.
Read more >
Web Authentication: An API for accessing Scoped ...
This specification defines an API enabling the creation and use of strong, attested, cryptographic scoped credentials by web applications, ...
Read more >
How can we trust authenticator data flags in fmt:none ...
I went to refresh my memory by taking a look at the spec and realized that if an RP never requests direct attestation...
Read more >
Handling unwanted or unsupported attestation formats #1485
For my own library I think accepting unsupported attestations as an 'unknown' type with the verification resulting in a "none" attestation ...
Read more >
Client to Authenticator Protocol (CTAP)
Abstract. This specification describes an application layer protocol for communication between a roaming authenticator and another ...
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