1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-30 22:41:33 +01:00

added NotAllowedError to assertCredential in fido2

This commit is contained in:
jng 2023-08-16 12:45:12 -04:00
parent 7d7549bef2
commit 7e257d58cf

View File

@ -38,6 +38,7 @@ export class Fido2ClientService implements Fido2ClientServiceAbstraction {
params: CreateCredentialParams, params: CreateCredentialParams,
abortController = new AbortController() abortController = new AbortController()
): Promise<CreateCredentialResult> { ): Promise<CreateCredentialResult> {
// debugger;
const enableFido2VaultCredentials = await this.configService.getFeatureFlagBool( const enableFido2VaultCredentials = await this.configService.getFeatureFlagBool(
FeatureFlag.Fido2VaultCredentials FeatureFlag.Fido2VaultCredentials
); );
@ -200,6 +201,13 @@ export class Fido2ClientService implements Fido2ClientServiceAbstraction {
throw new FallbackRequestedError(); throw new FallbackRequestedError();
} }
if (!params.sameOriginWithAncestors) {
this.logService?.warning(
`[Fido2Client] Invalid 'sameOriginWithAncestors' value: ${params.sameOriginWithAncestors}`
);
throw new DOMException("Invalid 'sameOriginWithAncestors' value", "NotAllowedError");
}
const { domain: effectiveDomain } = parse(params.origin, { allowPrivateDomains: true }); const { domain: effectiveDomain } = parse(params.origin, { allowPrivateDomains: true });
if (effectiveDomain == undefined) { if (effectiveDomain == undefined) {
this.logService?.warning(`[Fido2Client] Invalid origin: ${params.origin}`); this.logService?.warning(`[Fido2Client] Invalid origin: ${params.origin}`);