<?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>270553</bug_id>
          
          <creation_ts>2024-03-05 18:38:07 -0800</creation_ts>
          <short_desc>WebAuthn excludeCredentials option stopped preventing duplicate passkey registration</short_desc>
          <delta_ts>2024-04-03 16:44:53 -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>New Bugs</component>
          <version>Safari 17</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="nov matake">nov</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>arian.vanputten</cc>
    
    <cc>bfulgham</cc>
    
    <cc>earl.perez</cc>
    
    <cc>lgarron</cc>
    
    <cc>me</cc>
    
    <cc>pascoe</cc>
    
    <cc>rmondello</cc>
    
    <cc>timcappalli</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wilander</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2018943</commentid>
    <comment_count>0</comment_count>
    <who name="nov matake">nov</who>
    <bug_when>2024-03-05 18:38:07 -0800</bug_when>
    <thetext>iOS 17.4 Safari (maybe Safari 17.4?) stopped preventing duplicate passkey registration even excludeCredentials option is specified.

How to reproduce
1. sign-up at https://id.moneyforward.com
2. go to https://id.moneyforward.com/webauthn/credentials and register a passkey
3. after successful registration of the 1st passkey, register 2nd passkey again on the same device

until iOS 17.3, it resulted in an error.
since iOS 17.4, it start succeeds and RP start having 2+ passkeys for the same device.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2020627</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-03-12 19:39:11 -0700</bug_when>
    <thetext>&lt;rdar://problem/124497723&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2023861</commentid>
    <comment_count>2</comment_count>
    <who name="">arian.vanputten</who>
    <bug_when>2024-03-26 00:01:29 -0700</bug_when>
    <thetext>Same issue replicates on   Safari 17.4 on MacOS 14.4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2023869</commentid>
    <comment_count>3</comment_count>
    <who name="">arian.vanputten</who>
    <bug_when>2024-03-26 00:21:49 -0700</bug_when>
    <thetext>Note that this bug makes it extremely easy to lock yourself out of your accounts.

I just lost access to my GitHub account due to this.  (Until I find my recovery codes)

Steps to reproduce:


1. Add passkey to GitHub Account
2. Sign in with Passkey
3. Add another passkey to Github Account
   (GitHub sets excludeCredentials so that Safari shouldn&apos;t create another passkey)
4. Safari ignores excludeCredentials, throws away the old passkey and creates a new one
5. Github UI now shows two passkeys. 
6. Delete one of the two passkeys (In this case I deleted the newest one)
7. Log out
8. Try to sign in with passkey.  GitHub complains that the passkey is not known
9. Be completely locked out of your account</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2023895</commentid>
    <comment_count>4</comment_count>
    <who name="">arian.vanputten</who>
    <bug_when>2024-03-26 04:27:14 -0700</bug_when>
    <thetext>Another (more problematic scenario) is that this an cause account lockout under adverse network conditions without the user doing anything wrong in their view:

0. have an account logging in with passkeys. with credentialId: &quot;12345&quot;
1. call navigator.credentials.create({excludeCredentials:[&quot;12345&quot;]})
2. Instead of aborting due to a passkey already being stored, Safari creates a new credential &quot;54321&quot; and stores it in iCloud keychain, overriding &quot;12345&quot; in place. 
3. Network connectivity drops
4. the RP never receives the Credential from step 2. and still only has &quot;12345&quot; registered as an allowed Credential
4. User reloads page
5. User tries to log in with navigator.credentials.get({}).  Safari selects &quot;54321&quot; as that is the only passkey stored.
6. RP doesn&apos;t recognise &quot;54321&quot; and the user can not log in.
5. User is now permanently locked out of their account as their passkey got replaced with &quot;54321&quot; but the website only accepts &quot;12345&quot;.


Either Safari should start adhering `excludeCredentials` again or it should allow  storing multiple passkeys under a single `userHandle` (though I think that is not spec-compliant).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2024840</commentid>
    <comment_count>5</comment_count>
    <who name="Earl Perez">earl.perez</who>
    <bug_when>2024-03-29 15:11:07 -0700</bug_when>
    <thetext>+1

MDN docs show that excludeCredentials is fully supported on Safari. Safari 17.4 release notes doesn&apos;t even mention it.

https://developer.apple.com/documentation/safari-release-notes/safari-17_4-release-notes

https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API/WebAuthn_extensions#appidexclude

https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/create#excludecredentials</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025698</commentid>
    <comment_count>6</comment_count>
    <who name="Ricky Mondello">rmondello</who>
    <bug_when>2024-04-03 08:14:06 -0700</bug_when>
    <thetext>Hi folks! This issue is resolved in Safari Technology Preview 191 and we’ll ship the fix to “blue Safari” users as soon as we can. https://webkit.org/blog/15243/release-notes-for-safari-technology-preview-191/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025848</commentid>
    <comment_count>7</comment_count>
    <who name="nov matake">nov</who>
    <bug_when>2024-04-03 16:44:53 -0700</bug_when>
    <thetext>Cool!
I&apos;ve confirmed it&apos;s working as expected.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>