Bug 312458
| Summary: | Digital Credentials: UI process should verify user gesture authorization token | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Marcos Caceres <marcosc> |
| Component: | WebKit API | Assignee: | Marcos Caceres <marcosc> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | |||
| Bug Blocks: | 268516 | ||
Marcos Caceres
The Digital Credentials API requires transient activation (a user gesture) before presenting the credential chooser. This check is enforced in the web content process via consumeTransientActivation() in DigitalCredential::discoverFromExternalSource().
However, if the web content process is compromised, an attacker could bypass this check and send the ShowDigitalCredentialsPicker IPC message directly to the UI process. The UI process currently trusts that the web content process already validated the user gesture.
WebKit already has a UserGestureAuthorizationToken system for navigations (window.open): the UI process mints a UUID when dispatching input events and verifies it when the web process claims a navigation was user-initiated (see WebProcessProxy::consumeIfNotVerifiablyFromUIProcess).
We should extend this pattern to the Digital Credentials API:
1. Add a std::optional<WTF::UUID> gestureAuthorizationToken parameter to the ShowDigitalCredentialsPicker IPC message
2. In the web process, capture the token from UserGestureIndicator::currentUserGesture()->authorizationToken() before sending the IPC
3. In the UI process handler (WebPageProxy::showDigitalCredentialsPicker), verify the token against the recorded authorization tokens using MESSAGE_CHECK
This provides defense-in-depth: even if the renderer is compromised, the UI process independently verifies a real user gesture occurred before showing the credential picker.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/174908839>
Marcos Caceres
Pull request: https://github.com/apple/WebKit/pull/5178
Marcos Caceres
Pull request: https://github.com/WebKit/WebKit/pull/68592
EWS
Committed 317228@main (ed0fee7700f5): <https://commits.webkit.org/317228@main>
Reviewed commits have been landed. Closing PR #68592 and removing active labels.