Bug 224042

Summary: [Webauthn] navigator.credentials.create, with direct attestation, throws 'NotAllowedError.' error on MacOS11 M1 Chip
Product: WebKit Reporter: SG <siddharth.gupta26>
Component: WebKit Misc.Assignee: pascoe <pascoe>
Status: RESOLVED FIXED    
Severity: Normal CC: cyril.labbe, d.bussink, hgomi, jiewen_tan, loginllama, matthew, pascoe, tim.cappalli, webkit-bug-importer, webkit-bugzilla
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Mac (Apple Silicon)   
OS: macOS 11   
Attachments:
Description Flags
error popup on webauthn.me
none
mac os & chipset reference none

Description SG 2021-04-01 02:15:23 PDT
navigator.credentials.create throws 'NotAllowedError: This request has been cancelled by the user.' error when "direct" attestation is requested on MacOS Big Sur, Safari 14 browser 

Request
navigator.credentials.create({publicKey: {
    "rp": {
        "id": "",
        "name": ""
    },
    "user": {
        "name": "",
        "displayName": "",
        "id": 
    },
    "challenge":
    "pubKeyCredParams": [
        {
            "type": "public-key",
            "alg": -7
        }
    ],
    "authenticatorSelection": {
        "authenticatorAttachment": "platform"      
    },
    "attestation": "direct"
}})

Response 
NotAllowedError: This request has been cancelled by the user.
Comment 1 Radar WebKit Bug Importer 2021-04-08 02:16:21 PDT
<rdar://problem/76390431>
Comment 2 Cyril Labbe 2021-07-20 07:31:29 PDT
Created attachment 433873 [details]
error popup on webauthn.me
Comment 3 Cyril Labbe 2021-07-20 07:31:54 PDT
Created attachment 433874 [details]
mac os & chipset reference
Comment 4 Cyril Labbe 2021-07-20 07:33:26 PDT
issue also reported on the fido-dev google group
https://groups.google.com/a/fidoalliance.org/g/fido-dev/c/BHYtIkLTZbM

happens when attestation is "direct" or "indirect", not when "none"
happens on MacBook Pro M1 (no issue on intel MacBook)

the attestation ceremony proceed normally regarding the user (allows the domain to perform webauthn then use touchid), but ends up on an error popup
Comment 5 pascoe@apple.com 2021-11-11 09:19:49 PST
*** Bug 232950 has been marked as a duplicate of this bug. ***
Comment 6 Dirkjan Bussink 2021-12-16 02:19:15 PST
I'm also hitting this issue on trying to register with TouchID with Okta.

It reproduces as well on https://webauthn.me/debugger when registering with the attestation set to "direct" or "indirect". It works when it's set to "none".
Comment 7 login Llama 2022-02-09 15:13:58 PST
With attestation Direct

On Intel Safari 15.4 I get a not allowed error when Syncing platform authenticator is disabled.
When Syncing platform authenticator is enabled it works as expected.  

On M1 Safari 15.2 and STP 140 I get "The operation cannot be completed" if Syncing platform authenticator is enabled or disabled.

The expected behavior is that the browser should return an attestation of type none if the authenticator doesn't support attestation.  

 There is a WebAuthn issue to track this https://github.com/w3c/webauthn/issues/1697

It is possible that WebAuthn Level 3 will need to be updated to be more explicit on this so that platforms are consistent.
Comment 8 pascoe@apple.com 2022-02-09 15:26:04 PST
Hi, thank you for this report. We have identified the cause of this bug and a fix will be included in a future release.

You can test attestation on M1 now by installing both the public beta of macOS 12.3 and Safari Technical Preview 139.
Comment 9 Dirkjan Bussink 2022-03-17 12:24:45 PDT
I don't think this issue is fixed. I just tried on an M1 with 12.3 and the problem still exists and I can't register with any attestation configured.
Comment 10 Dirkjan Bussink 2022-03-22 12:20:40 PDT
Also tested on a non M1 Mac with 12.3 and it errors out now also there, so I think it's been a regression on all platforms?

I see now a "NotAllowedError: This request has been cancelled by the user." when trying to register on https://webauthn.me/debugger
Comment 11 login Llama 2022-03-22 14:59:27 PDT
An M1 with STP 141 on OSX 12.3 gives me "The operation cannot be completed" if attestation is direct for the platform authenticator.
Comment 12 Hidehito Gomi 2022-03-29 18:31:48 PDT
I don't think this is fixed. There seems to be a regression on non-M1 (Intel) chip.
I tested on an Intel Core i7 Macbook Pro (macOS Monterey 12.3) with Safari 15.4 and Safari Technology Preview 141, using TouchID.

navigator.credentials.create in each case threw 'NotAllowedError: This request has been cancelled by the user.' error when "direct" or "indirect" attestation for "platform" authenticator was requested.
Comment 13 pascoe@apple.com 2022-03-31 10:29:51 PDT
The fix for this issue is available in today's macOS Monterey‌‌‌ 12.3‌‌.1 update.
Comment 14 Dirkjan Bussink 2022-04-16 09:06:59 PDT
Can confirm that this is now fixed in 12.3.1 on both an M1 Mac and an Intel Mac.