<?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>258443</bug_id>
          
          <creation_ts>2023-06-23 00:43:18 -0700</creation_ts>
          <short_desc>Blob can&apos;t be read from opaque origined Workers</short_desc>
          <delta_ts>2023-10-18 04:30:14 -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>Safari Technology Preview</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 13</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=244862</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=243996</see_also>
          <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="Kaiido">tristan.fraipont</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>annevk</cc>
    
    <cc>cdumez</cc>
    
    <cc>kurt</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1963246</commentid>
    <comment_count>0</comment_count>
    <who name="Kaiido">tristan.fraipont</who>
    <bug_when>2023-06-23 00:43:18 -0700</bug_when>
    <thetext>Test-case: https://codepen.io/_-0-_/pen/qBQqbLy

Trying to read a Blob object with whatever method (`.arrayBuffer()` et al., `FileReader`, `new Response(blob).arrayBuffer()` etc.) from an opaque origin Web Worker throws an error:

&gt; [Error] Not allowed to load local resource: blob:null/70ccdfb9-8d83-4234-aec5-c45cb251b792
&gt; [Error] Cannot load blob:null/70ccdfb9-8d83-4234-aec5-c45cb251b792 due to access control checks.
&gt; [Error] Failed to load resource: Not allowed to request resource (70ccdfb9-8d83-4234-aec5-c45cb251b792, line 0)
&gt; [Error] Unhandled Promise Rejection: NotReadableError: The I/O read operation failed. (anonymous function) (data:text/javascript,%0A…%0A:3)

The issue seems to be that the fetch request made to access the blob&apos;s data goes through cross-origin checks, however the Blob should be by essence same origin, since it&apos;s supposed to be &quot;in memory&quot;. 
This happens for Workers created from a data: URL, as well as for the ones created from a blob: URL in a file:// document.

The weird thing is that it seems to work fine for opaque origin iframes (sandboxed or data: URL).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1964420</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-06-30 00:44:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/111555365&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>