Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/674-android-key-verification-2025 #675

Merged
merged 6 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
import { assertEquals } from '@std/assert';
import { FakeTime } from '@std/testing/time';

import { SettingsService } from '../../services/settingsService.ts';
import { verifyRegistrationResponse } from '../verifyRegistrationResponse.ts';
import { Google_Hardware_Attestation_Root_2 } from '../../services/defaultRootCerts/android-key.ts';

/**
* Clear out root certs for android-key since responses were captured from FIDO Conformance testing
* and have cert paths that can't be validated with known root certs from Google
*/
SettingsService.setRootCertificates({
identifier: 'android-key',
certificates: [],
});

Deno.test('should verify Android KeyStore response', async () => {
Deno.test('should verify Android Keystore response from FIDO Conformance in 2020', async () => {
SettingsService.setRootCertificates({
identifier: 'android-key',
certificates: [],
});

/**
* Faking time to something that'll satisfy all of these ranges:
*
* {
* notBefore: 1970-02-01T00:00:00.000Z,
* notAfter: 2099-01-31T23:59:59.000Z
* }
* {
* notBefore: 2019-04-25T05:49:32.000Z,
* notAfter: 2046-09-10T05:49:32.000Z
* }
*/
const mockDate = new FakeTime(new Date('2025-01-26T19:00:00.000Z'));

const verification = await verifyRegistrationResponse({
response: {
id: 'V51GE29tGbhby7sbg1cZ_qL8V8njqEsXpAnwQBobvgw',
Expand All @@ -34,4 +51,66 @@ Deno.test('should verify Android KeyStore response', async () => {
});

assertEquals(verification.verified, true);

mockDate.restore();
});

Deno.test('should verify Android Keystore response from a Pixel 8a in January 2025', async () => {
SettingsService.setRootCertificates({
identifier: 'android-key',
certificates: [Google_Hardware_Attestation_Root_2],
});

/**
* Faking time to something that'll satisfy all of these ranges:
*
* {
* notBefore: 1970-01-01T00:00:00.000Z,
* notAfter: 2048-01-01T00:00:00.000Z
* }
* {
* notBefore: 2025-01-07T17:08:43.000Z,
* notAfter: 2025-02-02T10:35:27.000Z
* }
* {
* notBefore: 2024-12-09T06:28:53.000Z,
* notAfter: 2025-02-17T06:28:52.000Z
* }
* {
* notBefore: 2022-01-26T22:49:45.000Z,
* notAfter: 2037-01-22T22:49:45.000Z
* }
* {
* notBefore: 2019-11-22T20:37:58.000Z,
* notAfter: 2034-11-18T20:37:58.000Z
* }
*/
const mockDate = new FakeTime(new Date('2025-02-02T10:00:00.000Z'));

const verification = await verifyRegistrationResponse({
response: {
id: 'AYNe4CBKc8H30FuAb8uaht6JbEQfbSBnS0SX7B6MFg8ofI92oR5lheRDJCgwY-JqB_QSJtezdhMbf8Wzt_La5N0',
rawId:
'AYNe4CBKc8H30FuAb8uaht6JbEQfbSBnS0SX7B6MFg8ofI92oR5lheRDJCgwY-JqB_QSJtezdhMbf8Wzt_La5N0',
response: {
attestationObject:
'o2NmbXRrYW5kcm9pZC1rZXlnYXR0U3RtdKNjYWxnJmNzaWdYSDBGAiEAs9Aufj5f5HyLKEFsgfmqyaXfAih-hGuTJqgmxZGijzYCIQDAMddAq1gwH3MtesYR6WE6IAockRz8ilR7CFw_kgdmv2N4NWOFWQLQMIICzDCCAnKgAwIBAgIBATAKBggqhkjOPQQDAjA5MSkwJwYDVQQDEyBkNjAyYTAzYTY3MmQ4NjViYTVhNDg1ZTMzYTIwN2M3MzEMMAoGA1UEChMDVEVFMB4XDTcwMDEwMTAwMDAwMFoXDTQ4MDEwMTAwMDAwMFowHzEdMBsGA1UEAxMUQW5kcm9pZCBLZXlzdG9yZSBLZXkwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATXVi3-n-rBsrP3A4Pj9P8e6PNh3eNdC38PaFiCZyMWdUVA6PbE6985PSUDDcnk3Knnpyc66J_HFOu_geuqiWtAo4IBgzCCAX8wDgYDVR0PAQH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-key',
clientExtensionResults: {
credProps: { rk: false },
},
authenticatorAttachment: 'platform',
},
expectedChallenge: 't4LWI0iYJSTWPl9WXUdNhdHAnrPDLF9eWAP9lHgmHP8',
expectedOrigin: 'http://localhost:8000',
expectedRPID: 'localhost',
requireUserVerification: false,
});

assertEquals(verification.verified, true);

mockDate.restore();
});
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,30 @@ export async function verifyAttestationAndroidKey(

if (!x5c) {
throw new Error(
'No attestation certificate provided in attestation statement (AndroidKey)',
'No attestation certificate provided in attestation statement (Android Key)',
);
}

if (!sig) {
throw new Error(
'No attestation signature provided in attestation statement (AndroidKey)',
'No attestation signature provided in attestation statement (Android Key)',
);
}

if (!alg) {
throw new Error(`Attestation statement did not contain alg (AndroidKey)`);
throw new Error(`Attestation statement did not contain alg (Android Key)`);
}

if (!isCOSEAlg(alg)) {
throw new Error(
`Attestation statement contained invalid alg ${alg} (AndroidKey)`,
`Attestation statement contained invalid alg ${alg} (Android Key)`,
);
}

// Check that credentialPublicKey matches the public key in the attestation certificate
/**
* Verify that the public key in the first certificate in x5c matches the credentialPublicKey in
* the attestedCredentialData in authenticatorData.
*/
// Find the public cert in the certificate as PKCS
const parsedCert = AsnParser.parse(x5c[0], Certificate);
const parsedCertPubKey = new Uint8Array(
Expand All @@ -64,17 +67,21 @@ export async function verifyAttestationAndroidKey(

if (!isoUint8Array.areEqual(credPubKeyPKCS, parsedCertPubKey)) {
throw new Error(
'Credential public key does not equal leaf cert public key (AndroidKey)',
'Credential public key does not equal leaf cert public key (Android Key)',
);
}

/**
* Verify that the attestationChallenge field in the attestation certificate extension data is
* identical to clientDataHash.
*/
// Find Android KeyStore Extension in certificate extensions
const extKeyStore = parsedCert.tbsCertificate.extensions?.find(
(ext) => ext.extnID === id_ce_keyDescription,
);

if (!extKeyStore) {
throw new Error('Certificate did not contain extKeyStore (AndroidKey)');
throw new Error('Certificate did not contain extKeyStore (Android Key)');
}

const parsedExtKeyStore = AsnParser.parse(
Expand All @@ -92,21 +99,25 @@ export async function verifyAttestationAndroidKey(
)
) {
throw new Error(
'Attestation challenge was not equal to client data hash (AndroidKey)',
'Attestation challenge was not equal to client data hash (Android Key)',
);
}

// Ensure that the key is strictly bound to the caller app identifier (shouldn't contain the
// [600] tag)
/**
* The AuthorizationList.allApplications field is not present on either authorization list
* (softwareEnforced nor teeEnforced), since PublicKeyCredential MUST be scoped to the RP ID.
*
* (i.e. These shouldn't contain the [600] tag)
*/
if (teeEnforced.allApplications !== undefined) {
throw new Error(
'teeEnforced contained "allApplications [600]" tag (AndroidKey)',
'teeEnforced contained "allApplications [600]" tag (Android Key)',
);
}

if (softwareEnforced.allApplications !== undefined) {
throw new Error(
'teeEnforced contained "allApplications [600]" tag (AndroidKey)',
'teeEnforced contained "allApplications [600]" tag (Android Key)',
);
}

Expand All @@ -121,21 +132,37 @@ export async function verifyAttestationAndroidKey(
});
} catch (err) {
const _err = err as Error;
throw new Error(`${_err.message} (AndroidKey)`);
throw new Error(`${_err.message} (Android Key)`);
}
} else {
/**
* Verify that x5c contains a full certificate path.
*/
const x5cNoRootPEM = x5c.slice(0, -1).map(convertCertBufferToPEM);
const x5cRootPEM = x5c.slice(-1).map(convertCertBufferToPEM);

try {
// Try validating the certificate path using the root certificates set via SettingsService
await validateCertificatePath(
x5c.map(convertCertBufferToPEM),
rootCertificates,
);
await validateCertificatePath(x5cNoRootPEM, x5cRootPEM);
} catch (err) {
const _err = err as Error;
throw new Error(`${_err.message} (AndroidKey)`);
throw new Error(`${_err.message} (Android Key)`);
}

/**
* Make sure the root certificate is one of the Google Hardware Attestation Root certificates
*
* https://developer.android.com/privacy-and-security/security-key-attestation#root_certificate
*/
if (rootCertificates.length > 0 && rootCertificates.indexOf(x5cRootPEM[0]) < 0) {
throw new Error('x5c root certificate was not a known root certificate (Android Key)');
}
}

/**
* Verify that sig is a valid signature over the concatenation of authenticatorData and
* clientDataHash using the public key in the first certificate in x5c with the algorithm
* specified in alg.
*/
const signatureBase = isoUint8Array.concat([authData, clientDataHash]);

return verifySignature({
Expand Down
88 changes: 88 additions & 0 deletions packages/server/src/services/defaultRootCerts/android-key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,91 @@ ZutL8VuFkERQGt6vQ2OCw0sV47VMkuYbacK/xyZFiRcrPJPb41zgbQj9XAEyLKCH
ex0SdDrx+tWUDqG8At2JHA==
-----END CERTIFICATE-----
`;

/**
* Google Hardware Attestation Root 3
*
* Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
* (third entry)
*
* Valid until 2036-11-13 @ 15:10 PST
*
* SHA256 Fingerprint
* AB:66:41:17:8A:36:E1:79:AA:0C:1C:DD:DF:9A:16:EB:45:FA:20:94:3E:2B:8C:D7:C7:C0:5C:26:CF:8B:48:7A
*/
export const Google_Hardware_Attestation_Root_3 = `
-----BEGIN CERTIFICATE-----
MIIFHDCCAwSgAwIBAgIJAMNrfES5rhgxMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjExMTE3MjMxMDQyWhcNMzYxMTEzMjMx
MDQyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
JtvsBslHZv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F452zvbiKKngEKirK5LGieoXBX7tZ9D1GNBH2
Ob3bKOwwIWdEFle/YF/h6zWgdeoaNGDqVBrLr2+0DtWoiB1aDEjLWl9FmyIUyUm7
mD/vFDkzF+wm7cyWpQpCVQ==
-----END CERTIFICATE-----
`;

/**
* Google Hardware Attestation Root 4
*
* Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate
* (fourth entry)
*
* Valid until 2042-03-15 @ 11:07 PDT
*
* SHA256 Fingerprint
* CE:DB:1C:B6:DC:89:6A:E5:EC:79:73:48:BC:E9:28:67:53:C2:B3:8E:E7:1C:E0:FB:E3:4A:9A:12:48:80:0D:FC
*/
export const Google_Hardware_Attestation_Root_4 = `
-----BEGIN CERTIFICATE-----
MIIFHDCCAwSgAwIBAgIJAPHBcqaZ6vUdMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjIwMzIwMTgwNzQ4WhcNNDIwMzE1MTgw
NzQ4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS
Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7
tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj
nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq
C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ
oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O
JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg
sTUVi2ghzq8wm27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5V3FJUcfHn
w1IdYIg2Wxg7yHcQZemFQg==
-----END CERTIFICATE-----
`;
6 changes: 5 additions & 1 deletion packages/server/src/services/settingsService.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { AttestationFormat } from '../helpers/decodeAttestationObject.ts';
import type { AttestationFormat } from '../helpers/decodeAttestationObject.ts';
import { convertCertBufferToPEM } from '../helpers/convertCertBufferToPEM.ts';

import { GlobalSign_Root_CA } from './defaultRootCerts/android-safetynet.ts';
import {
Google_Hardware_Attestation_Root_1,
Google_Hardware_Attestation_Root_2,
Google_Hardware_Attestation_Root_3,
Google_Hardware_Attestation_Root_4,
} from './defaultRootCerts/android-key.ts';
import { Apple_WebAuthn_Root_CA } from './defaultRootCerts/apple.ts';
import { GlobalSign_Root_CA_R3 } from './defaultRootCerts/mds.ts';
Expand Down Expand Up @@ -84,6 +86,8 @@ SettingsService.setRootCertificates({
certificates: [
Google_Hardware_Attestation_Root_1,
Google_Hardware_Attestation_Root_2,
Google_Hardware_Attestation_Root_3,
Google_Hardware_Attestation_Root_4,
],
});

Expand Down
Loading