<?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>208200</bug_id>
          
          <creation_ts>2020-02-25 08:52:58 -0800</creation_ts>
          <short_desc>A SecurityError is thrown when opening indexedDB in an iframe within a same subdomain tree</short_desc>
          <delta_ts>2026-01-25 21:45:49 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Website Storage</component>
          <version>Safari 13</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>http://a.indigital.io</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>165889</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Benoit F.">benoit.fleuriaud</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>annevk</cc>
    
    <cc>bfulgham</cc>
    
    <cc>cdumez</cc>
    
    <cc>marcosc</cc>
    
    <cc>sihui_liu</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1622623</commentid>
    <comment_count>0</comment_count>
    <who name="Benoit F.">benoit.fleuriaud</who>
    <bug_when>2020-02-25 08:52:58 -0800</bug_when>
    <thetext>If you open an IndexedDB connection in an iframe, it throws a SecurityError, that is completely normal if you are in a cross-origin context.

But what if you are in a domain, say &quot;a.example.com&quot;, and you embed an iframe with &quot;src&quot; equal to &quot;b.a.example.com&quot;.

The standard (https://html.spec.whatwg.org/multipage/origin.html#relaxing-the-same-origin-restriction) states that you can relax the same-origin restriction that would usually by applied by setting the &quot;document.domain&quot; to the same Second-Level Domain (SLD) in both parent and child contexts.

In my example, setting &quot;document.domain&quot; to &quot;example.com&quot; in the top window and the iframe window is legit and should put both in a same-origin context.

Here is a reproduction link (http://a.indigital.io) with a minimalist context. The iframe loads http://b.a.indigital.io, which is a subdomain of the opening window.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1836079</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-02-01 11:19:49 -0800</bug_when>
    <thetext>&lt;rdar://problem/88339063&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1974995</commentid>
    <comment_count>2</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2023-09-01 08:33:41 -0700</bug_when>
    <thetext>That is still cross-origin, though we might change that at some point to use same-site instead. Relaxing the restriction only applies to a select set of features and this is not one of them.

Nevertheless, these days you should not get an exception, but rather partitioned storage.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>