[wpt-sync] Sync PR 63515 - [PermissionsPolicy] Fix Allowlist::Contains() to match opaque origins for '*'
Categories
(Core :: DOM: Security, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox160 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 63515 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/63515
Details from upstream follow.
Hiroshige Hayashizaki <hiroshige@chromium.org> wrote:
[PermissionsPolicy] Fix Allowlist::Contains() to match opaque origins for '*'
This CL makes
PermissionsPolicy::Allowlist::Contains()return true
formatches_all_origins_(*policies) even for opaque origins, so
that a wildcard allowlist '*' matches all origins, including opaque
origins (e.g. sandboxed iframes or data: URL frames).This new behavior aligns with:
- The spec: https://w3c.github.io/webappsec-permissions-policy/#matches
FeaturePolicy::Allowlist::Contains()before
https://crrev.com/c/1430588 (which moved the '*' fallback after the
opaque origin early return)ParsedPermissionsPolicyDeclaration::Contains()The check order changes in this CL are:
- Check
matches_all_origins_first. This intentionally changes the
behavior as specified, which is covered by the added unit tests and
WPTs.- Check opaque origins before
allowed_origins_. This doesn't change
the behavior, becauseDoesMatchOrigin()always returns false for
opaque origins.This CL also updates
PermissionsPolicyTest.TestSandboxedFrameFromHeaderPolicyto properly
pass an empty container policy, matching its comments and ASCII diagram.Unit tests in
permissions_policy_unittest.cc(which mostly corresponds
to the tests to be deleted in https://crrev.com/c/8464750) and WPT tests
for wildcard '*' container policies with sandboxed and data: URL frames
are added.This also fixes the behavior of Worker permissions policy
(crbug.com/562705553) arounddata:workers, as
PermissionsPolicy::Allowlist::Contains()can be called e.g. from
ExecutionContext::IsFeatureEnabled()from
https://crrev.com/c/8426410/10/third_party/blink/renderer/core/workers/shared_worker.cc#298Bug: 565859110, 562705553
Change-Id: Ife867aba7e8309f499ffdce3304b288dfc50508d
TAG=agy
CONV=c5b4675c-907b-4a62-821b-dc605b21d806Reviewed-on: https://chromium-review.googlesource.com/8464749
WPT-Export-Revision: 0d7050e3958590cb24d80894e5d1aceb219aef54
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=103257
| Assignee | ||
Comment 2•1 month ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 2 tests and 1 subtests
Status Summary
Firefox
TIMEOUT: 4
Chrome
OK : 2
PASS : 2
Safari
TIMEOUT: 4
Links
Details
New Tests That Don't Pass
- /permissions-policy/policy-extends-to-data-url-all.html [wpt.fyi]:
TIMEOUT(Chrome:OK, Safari:TIMEOUT)- Permissions Policy with wildcard '*' extends to data: URL iframe with opaque origin:
TIMEOUT(Chrome:PASS, Safari:TIMEOUT)
- Permissions Policy with wildcard '*' extends to data: URL iframe with opaque origin:
- /permissions-policy/policy-extends-to-sandbox-all.html [wpt.fyi]:
TIMEOUT(Chrome:OK, Safari:TIMEOUT)- Permissions Policy with wildcard '*' extends to sandboxed frame with opaque origin:
TIMEOUT(Chrome:PASS, Safari:TIMEOUT)
- Permissions Policy with wildcard '*' extends to sandboxed frame with opaque origin:
Description
•