<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>314382</bug_id>
          
          <creation_ts>2026-05-08 01:48:45 -0700</creation_ts>
          <short_desc>Digital Credentials: Missing empty-vector guard after request validation allows empty picker presentation</short_desc>
          <delta_ts>2026-07-15 16:21:11 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>268516</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Marcos Caceres">marcosc</reporter>
          <assigned_to name="Marcos Caceres">marcosc</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2208914</commentid>
    <comment_count>0</comment_count>
    <who name="Marcos Caceres">marcosc</who>
    <bug_when>2026-05-08 01:48:45 -0700</bug_when>
    <thetext>When all org-iso-mdoc credential requests fail protocol-specific validation in the IdentityDocumentServices framework, CredentialRequestCoordinator::prepareCredentialRequest() proceeds to show the credential picker with an empty request data set, instead of rejecting the promise with a TypeError as required by the spec.

Steps to reproduce:
1. A website calls navigator.credentials.get() with one or more org-iso-mdoc requests
2. ALL requests contain malformed deviceRequest or encryptionInfo data that fails framework validation
3. The IdentityDocumentWebPresentmentRawRequestValidator rejects each request (console warnings are logged)
4. DigitalCredentials::validateRequests() returns an empty vector (no exception)

Expected: The promise should be rejected with a TypeError, matching the spec&apos;s &quot;Prepare credential requests&quot; algorithm step 7: &quot;If validatedRequests is empty, reject the credential request with a newly created TypeError.&quot;

Actual: The empty vector is passed to DigitalCredentialsRequestDataBuilder::build(), which wraps it in a DigitalCredentialsRequestData struct, then showDigitalCredentialsPicker() is called with empty request data.

Fix: Insert isEmpty() check after releaseReturnValue() and before setCurrentPromise() in CredentialRequestCoordinator::prepareCredentialRequest().

Spec reference: https://w3c-fedid.github.io/digital-credentials/#prepare-credential-requests (step 7)

rdar://176530716</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2208915</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-05-08 01:48:50 -0700</bug_when>
    <thetext>&lt;rdar://problem/176536555&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2208918</commentid>
    <comment_count>2</comment_count>
    <who name="Marcos Caceres">marcosc</who>
    <bug_when>2026-05-08 01:58:18 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/64534</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2230770</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-07-15 16:21:09 -0700</bug_when>
    <thetext>Committed 317276@main (fa01ab0b2a9c): &lt;https://commits.webkit.org/317276@main&gt;

Reviewed commits have been landed. Closing PR #64534 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>