Closed Bug 2091289 Opened 8 days ago Closed

[wpt-sync] Sync PR 64493 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=316512

Categories

(Core :: DOM: Security, task, P4)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 64493 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/64493
Details from upstream follow.

Roberto Rodriguez <roberto_rodriguez2@apple.com> wrote:

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=316512

WebKit export from bug: about:<!---->blank inherits cross-<!---->origin policy container due to empty document URL

<pre>
about:blank inherits cross-origin policy container due to empty document URL

Documents created via javascript: URL have an empty internal URL. Document::setURL() would
normally normalize this to aboutBlankURL(), but the call is conditionally skipped during
document creation.

When one of these documents creates a cross-origin iframe and then navigates it to about:blank,
the empty URL passes through NavigationRequester into NavigationAction::isEmpty(), which
mistakes it for an action that was never set. The fallback in FrameLoader::loadWithDocumentLoader
incorrectly rebuilds the action from the target frame's cross-origin document rather than the
original initiator (the javascript: URL document). The about:blank then inherits that document's
policy container instead of the initiator's, leaking its CSP and referrer via
SecurityPolicyViolationEvent.

Fix by normalizing empty document URLs to aboutBlankURL() in NavigationRequester::from(),
matching what Document::setURL() and Document::urlForBindings() already do.

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=316512">https://bugs.webkit.org/show_bug.cgi?id=316512</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/319079@main">https://commits.webkit.org/319079@main</a>
</pre>

Component: web-platform-tests → DOM: Security
Product: Testing → Core

CI Results

Ran 8 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 27 tests and 4 subtests

Status Summary

Firefox

OK : 1[GitHub] 25[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-windows11-64-25h2-opt] 26[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-64-25h2-debug]
PASS: 1[GitHub] 70[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-windows11-64-25h2-opt] 76[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-64-25h2-debug]
FAIL: 6

Chrome

OK : 1
PASS: 1

Safari

OK : 1
PASS: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

Status: NEW → RESOLVED
Closed: 4 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.