W3C home > Mailing lists > Public > public-webauthn@w3.org > January 2019

[webauthn] Is android-safetynet attestation trust path limited to one cert? (#1132)

From: Emil Lundberg via GitHub <sysbot+gh@w3.org>
Date: Tue, 15 Jan 2019 20:05:54 +0000
To: public-webauthn@w3.org
Message-ID: <issues.opened-399514067-1547582752-sysbot+gh@w3.org>
emlun has just created a new issue for https://github.com/w3c/webauthn:

== Is android-safetynet attestation trust path limited to one cert? ==
Section [ยง8.5. Android SafetyNet Attestation Statement Format][fmt] currently reads:

>[...]
>**Verification procedure**
>Given the verification procedure inputs attStmt, authenticatorData and clientDataHash, the verification procedure is as follows:
>- Verify that attStmt is valid CBOR conforming to the syntax defined above and perform CBOR decoding on it to extract the contained fields.
>- Verify that response is a valid SafetyNet response of version ver.
>- Verify that the nonce in the response is identical to the Base64 encoding of the SHA-256 hash of the concatenation of authenticatorData and clientDataHash.
>- Let attestationCert be the attestation certificate.
>- Verify that attestationCert is issued to the hostname "attest.android.com" (see SafetyNet online documentation).
>- Verify that the ctsProfileMatch attribute in the payload of response is true.
>- If successful, return implementation-specific values representing attestation type Basic and attestation trust path attestationCert.

In particular, notice:

>- Let attestationCert be the attestation certificate.
>[...]
>- return [...] attestation trust path attestationCert.

However, my Android device generated an attestation statement whose `response` attribute had this JWT header:

```
{
  "alg" : "RS256",
  "x5c" : [
    "MIIFkjCCBHqgAwIBAgIQRXroN0ZOdRkBAAAAAAPunzANBgkqhkiG9w0BAQsFADBCMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVR29vZ2xlIFRydXN0IFNlcnZpY2VzMRMwEQYDVQQDEwpHVFMgQ0EgMU8xMB4XDTE4MTAxMDA3MTk0NVoXDTE5MTAwOTA3MTk0NVowbDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxEzARBgNVBAoTCkdvb2dsZSBMTEMxGzAZBgNVBAMTEmF0dGVzdC5hbmRyb2lkLmNvbTCCASIwDQYJ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v8vNmkq7zdPGHXkxWY7oG9j+JkRyBABk7XrJfoucBZEqFJJSPk7XA0LKW0Y3z5oz2D0c1tJKwHAgMBAAGjggEzMIIBLzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFJjR+G4Q68+b7GCfGJAboOt9Cf0rMB8GA1UdIwQYMBaAFJviB1dnHB7AagbeWbSaLd/cGYYuMDUGCCsGAQUFBwEBBCkwJzAlBggrBgEFBQcwAYYZaHR0cDovL29jc3AucGtpLmdvb2cvZ3NyMjAyBgNVHR8EKzApMCegJaAjhiFodHRwOi8vY3JsLnBraS5nb29nL2dzcjIvZ3NyMi5jcmwwPwYDVR0gBDgwNjA0BgZngQwBAgIwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly9wa2kuZ29vZy9yZXBvc2l0b3J5LzANBgkqhkiG9w0BAQsFAAOCAQEAGoA+Nnn78y6pRjd9XlQWNa7HTgiZ/r3RNGkmUmYHPQq6Scti9PEajvwRT2iWTHQr02fesqOqBY2ETUwgZQ+lltoNFvhsO9tvBCOIazpswWC9aJ9xju4tWDQH8NVU6YZZ/XteDSGU9YzJqPjY8q3MDxrzmqepBCf5o8mw/wJ4a2G6xzUr6Fb6T8McDO22PLRL6u3M4Tzs3A2M1j6bykJYi8wWIRdAvKLWZu/axBVbzYmqmwkm5zLSDW5nIAJbELCQCZwMH56t2Dvqofxs6BBcCFIZUSpxu6x6td0V7SvJCCosirSmIatj/9dSSVDQibet8q/7UK4v4ZUN80atnZz1yg=="
  ]
}
```

It therefore seems to me like the above verification procedure should instead read something like this:

>- Let _x5c_ be the attestation certificate chain.
>- Let _attestationCert_ be the first element of _x5c_.
>[...]
>- return [...] attestation trust path _x5c_.

[fmt]: https://w3c.github.io/webauthn/#android-safetynet-attestation

Please view or discuss this issue at https://github.com/w3c/webauthn/issues/1132 using your GitHub account
Received on Tuesday, 15 January 2019 20:05:55 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 07:26:35 UTC