- Functionality: Implements the Background Fetch API (Spec), allowing service workers to initiate and manage large downloads (and potentially uploads) that persist even if the initiating page/tab is closed. Provides UI for tracking progress.
- Key Logic: Registering fetches (
BackgroundFetchManager
), managing download/upload jobs (BackgroundFetchJobController
), interacting with the download system and service workers, handling permissions and quotas, updating UI. - Core Files:
content/browser/background_fetch/
: Core browser-side implementation (e.g.,background_fetch_manager.cc
,background_fetch_job_controller.cc
).third_party/blink/renderer/modules/background_fetch/
: Renderer-side API implementation (BackgroundFetchManager
).components/background_fetch/
: Shared components.- Interaction with
content/browser/download/download_manager_impl.cc
andcontent/browser/service_worker/
.
- Policy Bypass (SameSite): Using Background Fetch registration or completion events to initiate requests that bypass SameSite cookie restrictions.
- VRP Pattern (SameSite Bypass): Background Fetch could be used to bypass SameSite=Lax cookie protections, potentially by having the completion event trigger a cross-site request. (VRP:
1244289
, VRP2.txt#10929). See privacy.md.
- VRP Pattern (SameSite Bypass): Background Fetch could be used to bypass SameSite=Lax cookie protections, potentially by having the completion event trigger a cross-site request. (VRP:
- Information Leaks (Resource Size): Leaking information about the size of cross-origin resources via the API's behavior or error reporting.
- VRP Pattern (Resource Size Leak): Differences in behavior or progress reporting when fetching cross-origin resources of different sizes could leak size information. (VRP:
1247376
,1260649
,1267311
; VRP2.txt#10920, #10690, #10871). See privacy.md.
- VRP Pattern (Resource Size Leak): Differences in behavior or progress reporting when fetching cross-origin resources of different sizes could leak size information. (VRP:
- Quota/Resource Exhaustion (DoS): Exploiting the API to consume excessive bandwidth, storage, or processing power without proper limits or cleanup.
- Permission/Scope Issues: Incorrectly handling permissions or allowing fetches outside the registered service worker's scope.
- Interaction with Downloads/Service Workers: Flaws in how Background Fetch interacts with the standard download manager or service worker lifecycle.
- SameSite Cookie Handling: Analyze how requests initiated by Background Fetch (both the fetch itself and any subsequent requests triggered by events like
backgroundfetchsuccess
) handle SameSite cookies. Ensure they are treated appropriately based on the context. (VRP:1244289
). - Resource Size Leak Mitigation: Review how fetch progress and completion are handled, especially for cross-origin requests, to prevent leaking size information through timing or distinct behaviors. (VRP:
1247376
, etc.). - Quota Management: How are storage and bandwidth quotas enforced for Background Fetch operations? Can these be bypassed or exhausted?
- Job Management (
BackgroundFetchJobController
): Analyze state management for fetch jobs. Look for race conditions or error handling flaws during download/upload processing, pausing, resuming, or aborting. - UI Security: Can the Background Fetch UI (progress notifications/bar) be spoofed or used to mislead the user?
BackgroundFetchManager
(Blink): Renderer-side API entry point (fetch
).BackgroundFetchManager
(Browser): Browser-side manager (StartFetch
). Handles registration and coordination.BackgroundFetchJobController
: Manages the lifecycle of a single Background Fetch job (downloads, uploads, events).BackgroundFetchDataManger
: Handles storage/persistence of fetch metadata.- Interaction points with
DownloadService
/DownloadManager
. - Interaction points with
ServiceWorkerContext
.
- SameSite Bypass: Test scenarios where Background Fetch events trigger navigations or subresource requests to ensure SameSite cookies are correctly handled.
- Resource Size Leaks: Design tests to probe timing differences or distinct behaviors based on resource size for cross-origin Background Fetches.
- Quota Enforcement: Test the effectiveness of storage and network quota limits.
- Error Handling: Analyze how failures during downloads/uploads within a Background Fetch job are handled and reported.
- SameSite Bypass: VRP:
1244289
/ VRP2.txt#10929 - Resource Size Leak: VRP:
1247376
,1260649
,1267311
; VRP2.txt#10920, #10690, #10871
(See also privacy.md, downloads.md, service_workers.md)