Change information
Commit message:
[M151] Validate browser-initiated file uploads
Original change's description:
> Validate browser-initiated file uploads
>
> This CL introduces token-based tracking and validation for files
> uploaded by the browser process to the network service.
>
> We introduce `BrowserFileAccessCallbacks` to `SimpleURLLoader`, allowing
> the browser to register file paths with `ChildProcessSecurityPolicy`.
> `ScopedBrowserFileAccess` manages token lifetimes for file paths
> originating from navigations (e.g., Web Share Target).
>
> Finally, `NetworkContextClientBaseImpl::HandleFileUploadRequest` is
> updated to validate the tokens using `CanBrowserReadFile()` when the
> originating process is the browser. This entire mechanism is gated
> behind the `kFileUploadTokenRegistration` feature flag, which is
> enabled by default.
>
> Bug: 497428001
> Change-Id: I8a06849dc69b19d3fa71c62ba2ed63813db686fa
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7968017
> Reviewed-by: Alex Moshchuk <ale...@chromium.org>
> Auto-Submit: Nidhi Jaju <nidh...@chromium.org>
> Commit-Queue: Nidhi Jaju <nidh...@chromium.org>
> Reviewed-by: Takashi Toyoshima <toyo...@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1657089}
(cherry picked from commit 1fc7b5f1b300973956c4edcb7e3f8f8d56a56e6a)
Bug: 532002490,497428001
Change-Id: I8a06849dc69b19d3fa71c62ba2ed63813db686fa
Cr-Commit-Position: refs/branch-heads/7922@{#580}
Cr-Branched-From: 059c884787b1bc15faa5afe5250f7d3a7e0ef64a-refs/heads/main@{#1654411}
Files:
- M content/browser/BUILD.gn
- M content/browser/browser_main_loop.cc
- M content/browser/loader/navigation_url_loader_impl.cc
- M content/browser/loader/navigation_url_loader_impl.h
- M content/browser/network_context_client_base_impl.cc
- M content/browser/network_context_client_base_impl_unittest.cc
- A content/browser/scoped_browser_file_access.cc
- A content/browser/scoped_browser_file_access.h
- M content/browser/security/cpsp/child_process_security_policy_impl.cc
- M content/browser/security/cpsp/child_process_security_policy_impl.h
- M content/browser/security/cpsp/child_process_security_policy_unittest.cc
- M content/public/browser/child_process_security_policy.h
- M services/network/public/cpp/features.cc
- M services/network/public/cpp/features.h
- M services/network/public/cpp/simple_url_loader.cc
- M services/network/public/cpp/simple_url_loader.h
Change size: L
Delta: 16 files changed, 369 insertions(+), 15 deletions(-)
Branch: refs/branch-heads/7922
Submit Requirements:
Code-Review: +1 by Mike West, +1 by Takashi Toyoshima, +1 by Rakina Zata Amni