FIDO Metadata Service (MDS)

Learn how to use the FIDO Metadata Service (MDS) in your WebAuthn Relying Party

Overview

The FIDO Metadata Service (MDS) is a collection of Metadata statements that can be used by a relying party to validate authenticator attestation. Each metadata statement contains data that outlines different characteristics of an authenticator, and to prove that the authenticity of the device where the credential was generated, and who manufactured the device.

Within the Metadata Service, each authenticator is granted an AAID (for authenticators that implement FIDO UAF) or a AAGUID (for authenticators that implement FIDO2). Additional characteristics that can be found in a Metadata statement include: • FIDO status/certification level • Device status • Transports • Attachment hint • Device Icon

Here is an example of a Metadata Statement for the YubiKey 5Ci

{
  "attestationCertificateKeyIdentifiers": [
    "bf7bcaa0d0c6187a8c6abbdd16a15640e7c7bde2",
    "753300d65dcc73a39a7db31ef308db9fa0b566ae",
    "b753a0e460fb2dc7c7c487e35f24cf63b065347c",
    "b6d44a4b8d4b0407872969b1f6b2263021be627e",
    "6d491f223af73cdf81784a6c0890f8a1d527a12c"
  ],
  "metadataStatement": {
    "legalHeader": "https://fidoalliance.org/metadata/metadata-statement-legal-header/",
    "attestationCertificateKeyIdentifiers": [
      "bf7bcaa0d0c6187a8c6abbdd16a15640e7c7bde2",
      "753300d65dcc73a39a7db31ef308db9fa0b566ae",
      "b753a0e460fb2dc7c7c487e35f24cf63b065347c",
      "b6d44a4b8d4b0407872969b1f6b2263021be627e",
      "6d491f223af73cdf81784a6c0890f8a1d527a12c"
    ],
    "description": "YubiKey 5Ci",
    "authenticatorVersion": 2,
    "protocolFamily": "u2f",
    "schema": 3,
    "upv": [
      {
        "major": 1,
        "minor": 1
      }
    ],
    "authenticationAlgorithms": [
      "secp256r1_ecdsa_sha256_raw"
    ],
    "publicKeyAlgAndEncodings": [
      "ecc_x962_raw"
    ],
    "attestationTypes": [
      "basic_full"
    ],
    "userVerificationDetails": [
      [
        {
          "userVerificationMethod": "presence_internal"
        }
      ]
    ],
    "keyProtection": [
      "hardware",
      "secure_element",
      "remote_handle"
    ],
    "matcherProtection": [
      "on_chip"
    ],
    "cryptoStrength": 128,
    "attachmentHint": [
      "external",
      "wired"
    ],
    "tcDisplay": [],
    "attestationRootCertificates": [
      "MIIDHjCCAgagAwIBAgIEG0BT9zANBgkqhkiG9w0BAQsFADAuMSwwKgYDVQQDEyNZdWJpY28gVTJGIFJvb3QgQ0EgU2VyaWFsIDQ1NzIwMDYzMTAgFw0xNDA4MDEwMDAwMDBaGA8yMDUwMDkwNDAwMDAwMFowLjEsMCoGA1UEAxMjWXViaWNvIFUyRiBSb290IENBIFNlcmlhbCA0NTcyMDA2MzEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC/jwYuhBVlqaiYWEMsrWFisgJ+PtM91eSrpI4TK7U53mwCIawSDHy8vUmk5N2KAj9abvT9NP5SMS1hQi3usxoYGonXQgfO6ZXyUA9a+KAkqdFnBnlyugSeCOep8EdZFfsaRFtMjkwz5Gcz2Py4vIYvCdMHPtwaz0bVuzneueIEz6TnQjE63Rdt2zbwnebwTG5ZybeWSwbzy+BJ34ZHcUhPAY89yJQXuE0IzMZFcEBbPNRbWECRKgjq//qT9nmDOFVlSRCt2wiqPSzluwn+v+suQEBsUjTGMEd25tKXXTkNW21wIWbxeSyUoTXwLvGS6xlwQSgNpk2qXYwf8iXg7VWZAgMBAAGjQjBAMB0GA1UdDgQWBBQgIvz0bNGJhjgpToksyKpP9xv9oDAPBgNVHRMECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAQEAjvjuOMDSa+JXFCLyBKsycXtBVZsJ4Ue3LbaEsPY4MYN/hIQ5ZM5p7EjfcnMG4CtYkNsfNHc0AhBLdq45rnT87q/6O3vUEtNMafbhU6kthX7Y+9XFN9NpmYxr+ekVY5xOxi8h9JDIgoMP4VB1uS0aunL1IGqrNooL9mmFnL2kLVVee6/VR6C5+KSTCMCWppMuJIZII2v9o4dkoZ8Y7QRjQlLfYzd3qGtKbw7xaF1UsG/5xUb/Btwb2X2g4InpiB/yt/3CpQXpiWX/K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F4I9YWzkBJTo46iUMzWp8Pir/RiduLxKYsSksV8vLlOQvhGX2YlR0OBhBjC+u/gEcvY0ApK7Yk41NxjPSQnWFHTF66UrjgevB8Cu5a+l2vYSRPtuVDo73hhdMSHnUX7tTjsVZGxAl/WptiOIEQ1gnL29mX6/tR1tmlkYj8W4X+CSjWcUDGY1NpS/C7hSKqiMLM/l2QmSWZ73Ddz+gio8BCENYPQ46qnkzwXUbqvBkxjUQsWfZFgbuo3rAf+wN7jOO90+ynx4Pi3L+0nYL1SchDUgAP4gPV/7Id1q+1HShmuGkIqWRPgyxMFqP8HfjTnjXwY5bQfbJct6OIzKgMHotF/He1egsaxHSqG6wfdmQ5x8NyTFFqBcp2iSowHR3yk5+36hF7vXAAAAAElFTkSuQmCC"
  },
  "statusReports": [
    {
      "status": "FIDO_CERTIFIED_L1",
      "effectiveDate": "2020-05-12",
      "certificationDescriptor": "YubiKey 5Ci",
      "certificateNumber": "U2F110020191017007",
      "certificationPolicyVersion": "1.1.1",
      "certificationRequirementsVersion": "1.3"
    }
  ],
  "timeOfLastStatusChange": "2020-05-12"
}

MDS Version 3.0

Version 3.0 of the MDS unlocks more ease of use by allowing a more streamlined way of integrating the repository into your own application. Older versions of MDS required you to find (or define) and integrate individual metadata statements. MDS 3.0 allows you to obtain the entire collection from a FIDO supported BLOB that is accessible without the need for registration, or an access token. This means that you can continuously call the central BLOB to pull up-to-date metadata statements into your application as frequently as your business requirements mandate.

MDS 3.0 also makes it easier for manufactures to keep the data related to their devices up-to date in order to allow FIDO applications to quickly react in the case of vulnerabilities on authenticators that were previously trusted.

The newest release of the Yubico java-webauthn-server now has built in support for MDS 3.0, allowing you to grab and store the repository locally, and to perform filtering on the collection. We will cover both concepts in the following section

Using the java-webauthn-server

Adding the Yubico java-webauthn-server to your Java project

The following lines should be added to your dependency file

<dependency>
    <groupId>com.yubico</groupId>
    <artifactId>webauthn-server-core</artifactId>
    <version>2.0.0</version>
</dependency>
<dependency>
    <groupId>com.yubico</groupId>
    <artifactId>webauthn-server-attestation</artifactId>
    <version>2.0.0</version>
</dependency>
<dependency>
    <groupId>com.yubico</groupId>
    <artifactId>yubico-util</artifactId>
    <version>2.0.0</version>
</dependency>

The project can also be found on GitHub at https://github.com/Yubico/java-webauthn-server

Downloading the FIDO MDS Repository

Your FIDO Server will need to download the MDS directly from the FIDO Alliance. The Yubico java-webauthn-server v2.0.0 has built in capabilities to download the repository. The following Java code sample can be used to initialize the MDS in your application.

downloader = FidoMetadataDownloader.builder()
  .expectLegalHeader("Put the legal header here (get exact wording from BLOB)")
  .useDefaultTrustRoot()
  .useTrustRootCache(new File("/tmp/fido-mds-trust-root-cache.bin"))
  .useDefaultBlob()
  .useBlobCache(new File("/tmp/fido-mds-blob-cache.bin"))
  .build();

Let’s explore this code in more detail. The first point of interest is "expectLegalHeader". By using the FIDO MDS, you will be held to it’s terms of service. This is a way to alert the developer and code reviewers that you are acknowledging the terms of the MDS, and any implications that may have on your application. The input into this method is the Legal Header that exists within the BLOB.

"Retrieval and use of this BLOB indicates acceptance of the appropriate agreement located at https://fidoalliance.org/metadata/metadata-legal-terms/"

Next you will get the Trust Root Certificates for the MDS. You can proceed with the default method using useDefaultTrustRoot() while building your downloader. Next is useTrustRootCache - the FIDO Spec notes that when grabbing the Trust Root Certificate, your app should have some sort of caching logic. Our example above is writing this to a file in a directory named "tmp"

The next two lines are used to download the BLOB repository. In this example we are pulling the default BLOB, and telling the downloader to cache it in the "tmp" directory.

The next step will be to create a FidoMetadataService Object as such

mds = FidoMetadataService.builder()
  .useDownloader(downloader)
  .build();

This will provide you with the metadataservice object that can be used when configuring your RelyingParty object:

RelyingParty rp =RelyingParty.builder()
  .identity(/*... */)
  .credentialRepository(/*... */)
  .attestationTrustSource(mds)
  .allowUntrustedAttestation(true); //Optional step: set to true (default) or false
  .build();

You may set allowUntrustedAttestation(false) to require trusted attestation for any new registrations.

If you do not wish to use the Default MDS BLOB you may use the following snippet which will allow you to enter in a BLOB that you retrieved from some other mechanism.

mds = FidoMetadataService.builder()
  .useBlob(/* Enter your BLOB payload here */)
  .build();

Filtering the MDS Repository

There may be cases where you do not want your WebAuthn server to trust certain authenticators. You may not want to allow credentials to register if they: are a specific authenticator, made by a specific company, have a known vulnerability, or aren’t a certain certification level.

You can add a filtering mechanism when defining the FidoMetadataService object to only include authenticators that have specific characteristics based on your business requirements.

The sample below will demonstrate how to filter for only platform authenticators (metadata statements where the Attachment Hint entry is "Internal").

FidoMetadataService.builder()
  .useBlob(downloader)
  .filter(blobEntry ->
    blobEntry.getMetadataEntry().getMetadataStatement().get()
    .getAttachmentHint().get().contains(AttachmentHint.ATTACHMENT_HINT_INTERNAL))
  .build();

Considerations

Err on the side of permissive

You don’t want to add an additional hurdle to your end users by requiring a specific authenticator, especially in the consumer space. Using the data provided by MDS will allow you to understand the authenticators that are being used by your users - and with that knowledge you can alert users if certain issues are found on their devices. If an authenticator is found to introduce security vulnerabilities, then begin to add it to a deny-list, but otherwise begin your implementation with allowing all trusted authenticators.

In the case of enterprise/high security applications it becomes more acceptable to use this data to filter on specific authenticators, or characteristics during the initial implementation.

Caching and Updating the Blob

The FIDO specification mentions the recommendation to cache the metadata BLOB object. The download example above will only grab the metadata BLOB when the WebAuthn Server is initially started. You may modify this behavior to grab an updated version of the repository on a cadence specified by your business requirements. The FIDO Alliance’s recommendation is to download the updated BLOB once a month. Caching will also help with performance as it may cut down on the time needed to grab the full repository in the case that the server requires a restart before the next scheduled update.

High Security Environments

Some applications, especially in the enterprise space, may require the use of specific authenticators. In this case instead of adding all of the repository into a Trusted Attestation group (and additionally filtering to get a subset of the entire BLOB), it might make more sense to construct your own BLOB with the limited authenticators that you plan to allow. MDS acts as a baseline for most Relying Parties, so it’s up to you to determine the affect on your users if you were to deny certain authenticators.