Bug 182893 - [WebAuthn] Require user gestures for LocalAuthenticator
Summary: [WebAuthn] Require user gestures for LocalAuthenticator
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jiewen Tan
URL:
Keywords: InRadar
Depends on:
Blocks: 181943
  Show dependency treegraph
 
Reported: 2018-02-16 15:27 PST by Jiewen Tan
Modified: 2020-04-30 21:43 PDT (History)
7 users (show)

See Also:


Attachments
Patch (40.21 KB, patch)
2020-04-29 15:12 PDT, Jiewen Tan
no flags Details | Formatted Diff | Diff
Patch (38.39 KB, patch)
2020-04-29 15:30 PDT, Jiewen Tan
no flags Details | Formatted Diff | Diff
Patch (31.80 KB, patch)
2020-04-29 18:32 PDT, Jiewen Tan
no flags Details | Formatted Diff | Diff
Patch (31.80 KB, patch)
2020-04-29 18:33 PDT, Jiewen Tan
bfulgham: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (31.78 KB, patch)
2020-04-30 21:15 PDT, Jiewen Tan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiewen Tan 2018-02-16 15:27:30 PST
Malicious sites could employ WebAuthN to bother users for requests to use biometrics infinitely. It would be nice to require user gestures to prevent such attacks.
Comment 1 Radar WebKit Bug Importer 2018-08-15 17:07:32 PDT
<rdar://problem/43357293>
Comment 2 Yuriy Ackermann (FIDO Alliance) 2018-08-29 17:15:30 PDT
Authenticators must do TUP/UV before every operation. The only check you must do is when attestation returned and its set DIRECT, then you must obtain consent from the user to return it to the server.

Biometrics authenticators block fingerprint after 5 tries per security requirements
Comment 3 Yuriy Ackermann (FIDO Alliance) 2018-08-29 17:17:00 PDT
https://w3c.github.io/webauthn/#user-verification
Comment 4 Jiewen Tan 2018-08-31 13:56:28 PDT
(In reply to Yuriy Ackermann (FIDO Alliance) from comment #2)
> Authenticators must do TUP/UV before every operation. The only check you
> must do is when attestation returned and its set DIRECT, then you must
> obtain consent from the user to return it to the server.
> 
> Biometrics authenticators block fingerprint after 5 tries per security
> requirements

Thanks for your comment. I didn't see that user consent is needed for "DIRECT" attestation in the https://www.w3.org/TR/webauthn/ as of Aug 7th 2018. I know FireFox does this.
Comment 5 Jiewen Tan 2018-08-31 13:58:38 PDT
Besides user gesture, we might want to consider:
2) focus, if the requesting page has focus,
3) or even background tab.
Comment 6 Yuriy Ackermann (FIDO Alliance) 2018-09-01 04:37:25 PDT
As far as I know Chrome/Firefox are blocking secure API's if page is out of focus:

> https://w3c.github.io/webauthn/#abortoperation

> The visibility and focus state of the Window object determines whether the [[Create]](origin, options, sameOriginWithAncestors) and [[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors) operations should continue. When the Window object associated with the [Document loses focus, [[Create]](origin, options, sameOriginWithAncestors) and [[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors) operations SHOULD be aborted.

Again, this has issues for softAuthenticatos, like SoftU2F, which obviously changes a focus and so causes API to fail. So need careful consideration
Comment 7 Jiewen Tan 2018-09-13 01:12:57 PDT
Another attach scenario could also be solved by requiring user gesture: https://www.w3.org/TR/webauthn/#sec-make-credential-privacy.
Comment 8 Jiewen Tan 2019-05-02 18:48:29 PDT
UserGesture is hard to be required for cross-platform authenticators as RPs nowadays like Google would not expect that. Instead, it should be required for our platform authenticators only.

Will have a separate bug to add the check whether the document has focus. This though can be required for all, which also aligns with Chromium.
Comment 9 Jiewen Tan 2020-04-29 15:12:55 PDT
Created attachment 398000 [details]
Patch
Comment 10 Jiewen Tan 2020-04-29 15:30:49 PDT
Created attachment 398001 [details]
Patch
Comment 11 Jiewen Tan 2020-04-29 18:32:13 PDT
Created attachment 398015 [details]
Patch
Comment 12 Jiewen Tan 2020-04-29 18:33:15 PDT
Created attachment 398016 [details]
Patch
Comment 13 Brent Fulgham 2020-04-30 13:11:34 PDT
Comment on attachment 398016 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398016&action=review

Looks good. r=me

> Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:-1194
> -    [[configuration preferences] _setEnabled:YES forExperimentalFeature:webAuthenticationLocalAuthenticatorExperimentalFeature()];

I assume these preferences are no longer needed, and this is just cleanup?
Comment 14 Jiewen Tan 2020-04-30 15:24:04 PDT
Comment on attachment 398016 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398016&action=review

Thanks Brent for the r+.

>> Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:-1194
>> -    [[configuration preferences] _setEnabled:YES forExperimentalFeature:webAuthenticationLocalAuthenticatorExperimentalFeature()];
> 
> I assume these preferences are no longer needed, and this is just cleanup?

No, I change the mock testing implementation such that it will have the feature enabled by default. In real environment, it is still a default off experimental feature.
Comment 15 EWS 2020-04-30 15:28:03 PDT
Tools/Scripts/svn-apply failed to apply attachment 398016 [details] to trunk.
Please resolve the conflicts and upload a new patch.
Comment 16 Jiewen Tan 2020-04-30 21:15:00 PDT
Created attachment 398157 [details]
Patch for landing
Comment 17 EWS 2020-04-30 21:43:33 PDT
Committed r260983: <https://trac.webkit.org/changeset/260983>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 398157 [details].