Bug 313498
| Summary: | [Site Isolation] Document::isSecureContext ignores RemoteFrame ancestors | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Anthony Tarbinian <a.tarbinian> |
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Anthony Tarbinian
In Document::isSecureContext, WebKit walks the frame tree to check
if all of a frame's ancestors are "secure". It does this to gate access to
powerful web APIs such as navigator.geolocation.
For each ancestor, we call Document::isDocumentSecure which performs
checks to see if the frame is potentially trustworthy. Below is the implementation.
It does the following:
1. If the document is sandboxed, it checks if the document's URL is trustworthy
2. Otherwise, check if the document's security origin is trustworthy.
```
static inline bool isDocumentSecure(const Document& document)
{
if (document.isSandboxed(SandboxFlag::Origin))
return isURLPotentiallyTrustworthy(document.url());
return document.securityOrigin().isPotentiallyTrustworthy();
}
```
With site isolation enabled, it is possible for some of the document's
ancestors to be RemoteFrames in different processes. Currently, the
code in Document::isSecureContext, only handles LocalFrames and silently
skips any RemoteFrame ancestors.
This bug causes imported/w3c/web-platform-tests/secure-contexts/basic-popup-and-iframe-tests.html
to fail with site isolation enabled.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/175714384>
EWS
Committed 312199@main (e211768ca32e): <https://commits.webkit.org/312199@main>
Reviewed commits have been landed. Closing PR #63753 and removing active labels.