Closed Bug 2063145 Opened 3 months ago Closed 3 months ago

[wpt-sync] Sync PR 61894 - Enforce LNA on Background Fetch requests

Categories

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

task

Tracking

()

RESOLVED FIXED
156 Branch
Tracking Status
firefox156 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

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

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

Chris Thompson <cthomp@chromium.org> wrote:

Enforce LNA on Background Fetch requests

This CL adds Local Network Access (LNA) enforcement for Background Fetch
requests. Before this CL, Background Fetch requests were executed by the
browser-level Download subsystem without the originating Service
Worker's ClientSecurityState, causing LNA restrictions to be bypassed.

Leveraging the SharedURLLoaderFactory interface plumbed in prior CLs,
this change updates BackgroundFetchJobController to:

  • Extract the ClientSecurityState from the originating Service Worker
    and create a bound SharedURLLoaderFactory from its StoragePartition.
  • Dynamically re-initialize the URLLoaderFactory upon job resumption or
    browser restarts by retrieving the Service Worker registration.

This CL also adds tests for verifying the LNA restrictions:

  • Desktop LNA browser tests in background_fetch_browsertest.cc.
  • Web Platform Test (WPT) suite under virtual/lna-bg-fetch/.

LNA enforcement is gated behind the kBackgroundFetchLocalNetworkAccess
feature flag.

Bug: 455486148
TAG=agy
CONV=96c12324-004c-4da1-bec2-9436ea828a56
BYPASS_LARGE_CHANGE_WARNING: misidentified tests as prod
Change-Id: I31532bd0ed2bf6765d9af2e66cb209a5b505abd1
Reviewed-on: https://chromium-review.googlesource.com/8103102
WPT-Export-Revision: 1c598d40ba10d7088e28742eb7c33e2a06a2a25f

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

CI Results

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

Total 17 tests and 4 subtests

Status Summary

Firefox

OK : 1[GitHub] 12[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] 14[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt] 15[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS : 5[GitHub] 37[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] 45[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt] 52[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL : 2[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-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 4[GitHub]
TIMEOUT: 2
NOTRUN : 1

Chrome

OK : 2
PASS : 10
FAIL : 1

Safari

TIMEOUT: 4
NOTRUN : 9

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /fetch/local-network-access/service-worker.tentative.https.html [wpt.fyi]: OK [Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt, GitHub], SKIP [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-linux2404-64-debug, Gecko-linux2404-64-opt] (Chrome: OK, Safari: TIMEOUT)
    • LNA Service Worker Public to Loopback Fetch without permission: FAIL [GitHub], PASS [Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] (Chrome: PASS, Safari: NOTRUN)
    • LNA Service Worker Public to Loopback WebSocket without permission: FAIL [GitHub], PASS [Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] (Chrome: PASS, Safari: NOTRUN)
    • LNA Service Worker Public navigate to Loopback in iframe without permission: FAIL [GitHub], PASS [Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] (Chrome: PASS, Safari: NOTRUN)
    • LNA Service Worker Public to Loopback WebTransport without permission: FAIL (Chrome: PASS, Safari: NOTRUN)
  • /fetch/local-network-access/webtransport.tentative.https.html [wpt.fyi]: SKIP
  • /fetch/local-network-access/dedicated-worker.tentative.https.html [wpt.fyi]: OK [Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], SKIP [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]
  • /fetch/local-network-access/fetch.tentative.https.html [wpt.fyi]
    • LNA Public to local http mixed content bypass: FAIL
  • /fetch/local-network-access/iframe-opener.tentative.https.html [wpt.fyi]
    • LNA Public to loopback navigate iframe from opener without permission: FAIL
  • /fetch/local-network-access/service-worker-background-fetch.tentative.https.html [wpt.fyi]: TIMEOUT (Chrome: OK, Safari: TIMEOUT)
    • LNA Service Worker Public to Loopback Background Fetch with permission: TIMEOUT (Chrome: PASS, Safari: TIMEOUT)
    • LNA Service Worker Public to Loopback Background Fetch without permission: NOTRUN (Chrome: FAIL, Safari: NOTRUN)
  • /fetch/local-network-access/shared-worker.tentative.https.html [wpt.fyi]: OK [Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], SKIP [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]

Tests Disabled in Gecko Infrastructure

Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 156 Branch
Regressions: 2064782
You need to log in before you can comment on or make changes to this bug.