WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
311888
Digital Credentials: CredentialsContainer::get() skips CredMan-level precondition checks
https://bugs.webkit.org/show_bug.cgi?id=311888
Summary
Digital Credentials: CredentialsContainer::get() skips CredMan-level precondi...
Marcos Caceres
Reported
2026-04-09 18:38:48 PDT
The Digital Credentials path in CredentialsContainer::get() bypasses several precondition checks that the Credential Management spec's "Request a Credential" algorithm (§2.5.1) requires before dispatching to [[DiscoverFromExternalSource]]. Gaps: 1. **Mediation conditional check (step 8a)**: The CredMan spec requires rejecting with TypeError when mediation is "conditional" and the credential type doesn't support it. Digital credentials don't support conditional mediation, but this wasn't checked in the CredMan layer. 2. **Permissions Policy check (step 11)**: The Permissions Policy check for `digital-credentials-get` was implemented inside DigitalCredential::discoverFromExternalSource() rather than in CredentialsContainer::get() where the spec requires it. 3. **"Fully active descendant of top-level traversable with user attention" (DC spec step 5)**: The implementation used Document::hasFocus() + visibilityState(), which is MORE restrictive than the spec requires. hasFocus() requires the focused frame to be a descendant of the calling document's frame, which breaks cross-origin iframes with `allow="digital-credentials-get"`. The spec's concept uses isFullyActive() + page-level visibility/focus (system attention on the top-level traversable). 4. **Wrong error code for concurrent requests**: CredentialRequestCoordinator rejected concurrent requests with InvalidStateError, but the CredMan spec requires NotAllowedError. Fix: - Add Document::isFullyActiveDescendantOfTopLevelTraversableWithUserAttention() using isFullyActive() + Page::isVisibleAndActive() - Move Permissions Policy and mediation conditional checks to CredentialsContainer::get() - Fix error code in CredentialRequestCoordinator from InvalidStateError to NotAllowedError Branch: eng/credman-dc-security-checks
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2026-04-16 18:39:13 PDT
<
rdar://problem/174971012
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug