<?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>317300</bug_id>
          
          <creation_ts>2026-06-17 07:24:39 -0700</creation_ts>
          <short_desc>Digital Credentials: validation failures are silently dropped instead of throwing a classified exception (TypeError / OperationError)</short_desc>
          <delta_ts>2026-07-13 20:42:54 -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>NEW</bug_status>
          <resolution></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="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2221569</commentid>
    <comment_count>0</comment_count>
    <who name="Marcos Caceres">marcosc</who>
    <bug_when>2026-06-17 07:24:39 -0700</bug_when>
    <thetext>The Digital Credentials spec change in w3c-fedid/digital-credentials#515 (&quot;Classify validation failures into specific exception types&quot;) updates the &quot;Validate credential requests&quot; algorithm so that a validation failure throws a specific exception: a TypeError when the request data is malformed or invalid, otherwise an &quot;OperationError&quot; DOMException. The fail-fast contract is unchanged; #515 only pins down the exception type.

WebKit does not implement this. In DigitalCredentials::validateRequests (Source/WebKit/WebProcess/cocoa/IdentityDocumentServices/DigitalCredentialsRequestValidatorBridge.mm), each request is validated in a loop; on a validation failure the code adds a console warning (&quot;An error occurred validating the incoming &apos;org-iso-mdoc&apos; request. The request will be ignored.&quot;), then drops that request and continues. The function returns a plain Vector&lt;ValidatedMobileDocumentRequest&gt; (not an ExceptionOr), so it has no channel to surface a validation-failure exception at all. DigitalCredentialsCoordinator::validateAndParseDigitalCredentialRequests wraps the plain vector into a successful result.

This means a request set with some invalid entries silently proceeds with a partial set, and a set where every entry fails validation returns an empty vector that is then treated as success: bug 314382 (the missing empty-vector guard) tracks that empty-vector case.

Note: the TypeError/NotAllowedError exceptions currently thrown in DigitalCredential::discoverFromExternalSource belong to the earlier &quot;Initiate the credential request&quot;/binding layer (permissions policy, focus, visibility, IDL/JSON conversion, &quot;at least one request&quot;), not to the per-request &quot;Validate credential requests&quot; step that #515 governs.

Proposed fix (the plumbing already supports it): the client interface validateAndParseDigitalCredentialRequests already returns ExceptionOr&lt;Vector&lt;...&gt;&gt;, and CredentialRequestCoordinator::prepareCredentialRequests already rejects the promise with releaseException(). Change DigitalCredentials::validateRequests to return ExceptionOr&lt;...&gt; and, on the platform validator&apos;s failure, return a TypeError (malformed/invalid request data) or an &quot;OperationError&quot; DOMException (otherwise) per the #515 switch, instead of logging-and-dropping.

Spec PR: https://github.com/w3c-fedid/digital-credentials/pull/515
Spec issue: https://github.com/w3c-fedid/digital-credentials/issues/472</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2221570</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-06-17 07:24:46 -0700</bug_when>
    <thetext>&lt;rdar://problem/179927860&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>