WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
208200
A SecurityError is thrown when opening indexedDB in an iframe within a same subdomain tree
https://bugs.webkit.org/show_bug.cgi?id=208200
Summary
A SecurityError is thrown when opening indexedDB in an iframe within a same s...
Benoit F.
Reported
2020-02-25 08:52:58 PST
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 "a.example.com", and you embed an iframe with "src" equal to "b.a.example.com". 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 "document.domain" to the same Second-Level Domain (SLD) in both parent and child contexts. In my example, setting "document.domain" to "example.com" 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.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2022-02-01 11:19:49 PST
<
rdar://problem/88339063
>
Anne van Kesteren
Comment 2
2023-09-01 08:33:41 PDT
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.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug