Bug 302102
| Summary: | [Site Isolation] Incorrect origin for about:blank iframes | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Anthony Tarbinian <a.tarbinian> |
| Component: | WebKit Process Model | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | nham, webkit-bug-importer |
| Priority: | P1 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | All | ||
| OS: | Unspecified | ||
Anthony Tarbinian
Summary:
With site isolation turned on, when a cross origin iframe navigates back to about:blank it keeps its cross origin status.
Steps To Reproduce:
1. Open a page to `about:blank`
2. Open the WebInspector
3. Run the following JS commands in the console:
```
let i = document.createElement('iframe'); document.body.appendChild(i);
i.src="https://example.com"
i.src="about:blank"
i.contentWindow.document.body.appendChild(i.contentWindow.document.createTextNode('some text'))
```
Results:
Observe how attempting to modify the DOM of the about:blank is blocked with a SecurityError: “SecurityError: Blocked a frame with origin "null" from accessing a cross-origin frame. Protocols, domains, and ports must match..”
According to the HTML spec (https://html.spec.whatwg.org/multipage/browsing-the-web.html#beginning-navigation):
> If url matches about:blank or is about:srcdoc, then:
>
> Set documentState's origin to initiatorOriginSnapshot.
>
> Set documentState's about base URL to initiatorBaseURLSnapshot.
Regression:
Problem reproducibly occurs on WebKit with site isolation enabled. With site isolation off, the DOM of the about:blank iframe is able to be modified by the main frame.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Anthony Tarbinian
<rdar://problem/160706600>
Anthony Tarbinian
Pull request: https://github.com/WebKit/WebKit/pull/52845
EWS
Committed 303299@main (84738405475e): <https://commits.webkit.org/303299@main>
Reviewed commits have been landed. Closing PR #52845 and removing active labels.
Anthony Tarbinian
Broke scrolling with site isolation (see https://bugs.webkit.org/show_bug.cgi?id=303451). Original commit was reverted, so re-opening this issue.
Anthony Tarbinian
Pull request: https://github.com/WebKit/WebKit/pull/54861