<?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>272678</bug_id>
          
          <creation_ts>2024-04-15 07:44:09 -0700</creation_ts>
          <short_desc>Handling stale index value in Element setAttribute() API due to the call of getTrustedTypesCompliantAttributeValue()</short_desc>
          <delta_ts>2024-05-16 06:05:46 -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>DOM</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>
          
          <blocked>266630</blocked>
    
    <blocked>271823</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter>zsun</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ashvayka</cc>
    
    <cc>lwarlow</cc>
    
    <cc>mark.lam</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
    
    <cc>zsun</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2028524</commentid>
    <comment_count>0</comment_count>
    <who name="">zsun</who>
    <bug_when>2024-04-15 07:44:09 -0700</bug_when>
    <thetext>With the change at https://github.com/WebKit/WebKit/pull/26519, it calls getTrustedTypesCompliantAttributeValue in Element setAttribute() API. The getTrustedTypesCompliantAttributeValue can result in JS execution which may mutate the attributes of the element and make the index value used in this function stale.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2028527</commentid>
    <comment_count>1</comment_count>
      <attachid>470925</attachid>
    <who name="">zsun</who>
    <bug_when>2024-04-15 07:47:28 -0700</bug_when>
    <thetext>Created attachment 470925
bug.html

The attached test file should result in the &quot;srcdoc&quot; being the string &quot;alert(1)&quot;.  It results in onmouseover=&quot;alert(1)&quot; instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2030212</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-04-22 08:53:38 -0700</bug_when>
    <thetext>&lt;rdar://problem/126863617&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2035768</commentid>
    <comment_count>3</comment_count>
    <who name="">zsun</who>
    <bug_when>2024-05-16 06:05:46 -0700</bug_when>
    <thetext>This has been addressed at https://github.com/WebKit/WebKit/pull/26519</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>470925</attachid>
            <date>2024-04-15 07:47:28 -0700</date>
            <delta_ts>2024-04-15 07:47:28 -0700</delta_ts>
            <desc>bug.html</desc>
            <filename>bug.html</filename>
            <type>text/html</type>
            <size>424</size>
            <attacher>zsun</attacher>
            
              <data encoding="base64">PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1TZWN1cml0eS1Qb2xpY3kiIGNvbnRlbnQ9InJlcXVp
cmUtdHJ1c3RlZC10eXBlcy1mb3IgJ3NjcmlwdCc7IHRydXN0ZWQtdHlwZXMgZGVmYXVsdDsiPgo8
Ym9keT4KPGlmcmFtZSBpZD0iaWZyYW1lIiBkYXRhLXg9IiIgc3JjZG9jPSJjb250ZW50IiBvbm1v
dXNlb3Zlcj0iIj48L2lmcmFtZT4KPHNjcmlwdD4KICAgIHRydXN0ZWRUeXBlcy5jcmVhdGVQb2xp
Y3koJ2RlZmF1bHQnLCB7CiAgICAgICAgY3JlYXRlSFRNTDogKHMpID0+IHsKICAgICAgICAgICAg
aWZyYW1lLnJlbW92ZUF0dHJpYnV0ZSgnZGF0YS14Jyk7CiAgICAgICAgICAgIHJldHVybiBzOwog
ICAgICAgIH0KICAgIH0pOwogICAgaWZyYW1lLnNldEF0dHJpYnV0ZSgnc3JjZG9jJywgImFsZXJ0
KDEpIik7Cjwvc2NyaXB0Pgo8L2JvZHk+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>