Closed Bug 1902732 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 46763 - [shared storage] Bugfix: Check the permissions policy against the script origin

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox129 fixed)

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Attachments

(1 file)

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

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

Yao Xiao <yaoxia@chromium.org> wrote:

[shared storage] Bugfix: Check the permissions policy against the script origin

When creating or using a cross-origin worklet, the code is doing the
wrong checks via IsFeatureEnabled(...) (for all "shared-storage",
"shared-storage-select-url", and "private-aggregation"). It should
instead be policy->IsFeatureEnabledForOrigin(...) which checks against
the script origin (i.e. the worklet/data/security origin), as
specified in the spec.

We move the permissions check to after the "was addModule invoked"
check. This way, we can use a single worklet_host_ state to
track both "addModule invoked" status and "shared_storage_origin_" eligibility, reducing state management overhead. As a result:

  • This also eliminates redundant checks for the
    "shared-storage" permissions policy during selectURL() & run().
  • We'd have to relax some assertions in WPT by not asserting the
    exact error messages. This is nevertheless the desired pattern,
    as the error messages are not part of the spec.

Bug: 347047842
Change-Id: I9e14810e803af20fb0b5cc7837c6b434f887ab9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5630917
Reviewed-by: Cammie Smith Barnes \<cammie@chromium.org>
Commit-Queue: Cammie Smith Barnes \<cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1315333}

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Attached file Notable wpt changes
# CI Results Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI Total 72 tests and 1 subtests ## Status Summary ### Firefox `OK` : 11[Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] 47[GitHub] `PASS` : 8 `FAIL` : 36[Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] 119[GitHub] `TIMEOUT`: 52 `ERROR` : 4 `NOTRUN` : 10 ### Chrome `OK` : 24 `PASS` : 13 `FAIL` : 29 `TIMEOUT`: 103 `ERROR` : 2 `NOTRUN` : 69 ### Safari `OK` : 47 `PASS` : 8 `FAIL` : 119 `TIMEOUT`: 53 `ERROR` : 3 `NOTRUN` : 10 ## Links [Gecko CI (Treeherder)](https://treeherder.mozilla.org/#/jobs?repo=try&revision=7e6d38bc9c8450a4c6cc13c2aeb2870bf26f41b5) [GitHub PR Head](https://wpt.fyi/results/?sha=a19da9745085a317ebdfbf046f77b44cddd934ef&label=pr_head) [GitHub PR Base](https://wpt.fyi/results/?sha=a19da9745085a317ebdfbf046f77b44cddd934ef&label=pr_base) ## Details (See attachment for full changes)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2fe914b660f8 [wpt PR 46763] - [shared storage] Bugfix: Check the permissions policy against the script origin, a=testonly https://hg.mozilla.org/integration/autoland/rev/ce720b1a4625 [wpt PR 46763] - Update wpt metadata, a=testonly
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: