Update initiator state token on policy update [chromium/src : main]

0 views
Skip to first unread message

Camille Lamy (Gerrit)

unread,
Jul 30, 2026, 10:24:04 AM (19 hours ago) Jul 30
to Alex Moshchuk, Mike West, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Daniel Cheng, Dirk Schulze, Fredrik Söderquist, Nate Chapin, Mike Taylor, Hiroki Nakagawa, prerendering-reviews, Stephen Chenney, Victor Tan, alexmo...@chromium.org, asvitkine...@chromium.org, blink-isola...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, chikamu...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cros-print...@google.com, devtools-re...@chromium.org, extension...@chromium.org, fmalit...@chromium.org, gavinp...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, loading...@chromium.org, navigation...@chromium.org, pdr+svgw...@chromium.org, print-rev...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, video-networking...@google.com
Attention needed from Alex Moshchuk and Mike West

Camille Lamy added 3 comments

Patchset-level comments
File-level comment, Patchset 7 (Latest):
Camille Lamy . resolved

PTAL.

File content/browser/renderer_host/navigation_request.cc
Line 3640, Patchset 7 (Latest): // such changes and update the `initiator_state_token_to_commit`.
Camille Lamy . unresolved

It seems the DocumentLoader in Blink might attempt to modify the CSP in the PolicyContainerHost in DocumentLoader::CreateCSP called from DocumentLoader::InitializeWindow. I am not sure we have actually committed the navigation at that point, which is the time where the PolicyContainerHost gets moved into the RenderFrameHostImpl and the RFH sets itself as the PolicyContainerHost::Client. To avoid an update of the initiator_state_token getting missed during this timeframe, I am having the NavigationRequest be the client until we pass the PolicyContainerHost to the RFH. The NavigationRequest also stores the initiator_state_token_to_commit_, so it can just update it if needed, passing the PCH with the right policies and matching token to RFH at commit time.

File content/browser/renderer_host/policy_container_host.h
Line 303, Patchset 7 (Parent): CHECK(!client_);
Camille Lamy . unresolved

I had to remove those checks because the NavigationRequest now sets itself as the client of the PolicyContainerHost prior to those being called. See comment in NavigationRequest for why. Since we're still requesting the NavigationPolicyContainerBuilder as a PassKey this is fine I think, as that means the PCH is not assigned to an RFH yet, so modifying browser process-only policies should be fine.

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Mike West
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I77f77b25be2ecfddf95f06488ef2f9e0e4081914
Gerrit-Change-Number: 8156368
Gerrit-PatchSet: 7
Gerrit-Owner: Camille Lamy <cl...@chromium.org>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
Gerrit-Reviewer: Mike West <mk...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Fredrik Söderquist <f...@opera.com>
Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
Gerrit-CC: Mike Taylor <mike...@chromium.org>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-CC: Victor Tan <vict...@chromium.org>
Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
Gerrit-Attention: Mike West <mk...@chromium.org>
Gerrit-Comment-Date: Thu, 30 Jul 2026 14:23:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Alex Moshchuk (Gerrit)

unread,
Jul 30, 2026, 9:23:45 PM (8 hours ago) Jul 30
to Camille Lamy, Mike West, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, Daniel Cheng, Dirk Schulze, Fredrik Söderquist, Nate Chapin, Mike Taylor, Hiroki Nakagawa, prerendering-reviews, Stephen Chenney, Victor Tan, alexmo...@chromium.org, asvitkine...@chromium.org, blink-isola...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, blink-work...@chromium.org, chikamu...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, cros-print...@google.com, devtools-re...@chromium.org, extension...@chromium.org, fmalit...@chromium.org, gavinp...@chromium.org, gavin...@chromium.org, horo+...@chromium.org, ipc-securi...@chromium.org, kinuko+ser...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, loading...@chromium.org, navigation...@chromium.org, pdr+svgw...@chromium.org, print-rev...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, tburkar...@chromium.org, video-networking...@google.com
Attention needed from Camille Lamy and Mike West

Alex Moshchuk voted and added 4 comments

Votes added by Alex Moshchuk

Code-Review+1

4 comments

Patchset-level comments
Alex Moshchuk . unresolved

Thanks! This CL LGTM for content/.

At some point, I do want to come back to the question at https://chromium-review.git.corp.google.com/c/chromium/src/+/8024863/comment/2c8923c1_34286659/ and specifically how to avoid trusting the renderer-provided initiator state tokens. Maybe we can scope them to a process somehow, or combine with the RFH's document token, so that if an attacker process A somehow learns about a token belonging to process B (via a side channel, etc), it can't start navigations with a token that maps to initiator state belonging to some random cross-site frame?

File content/browser/renderer_host/navigation_request.cc
Line 3640, Patchset 7 (Latest): // such changes and update the `initiator_state_token_to_commit`.
Camille Lamy . resolved

It seems the DocumentLoader in Blink might attempt to modify the CSP in the PolicyContainerHost in DocumentLoader::CreateCSP called from DocumentLoader::InitializeWindow. I am not sure we have actually committed the navigation at that point, which is the time where the PolicyContainerHost gets moved into the RenderFrameHostImpl and the RFH sets itself as the PolicyContainerHost::Client. To avoid an update of the initiator_state_token getting missed during this timeframe, I am having the NavigationRequest be the client until we pass the PolicyContainerHost to the RFH. The NavigationRequest also stores the initiator_state_token_to_commit_, so it can just update it if needed, passing the PCH with the right policies and matching token to RFH at commit time.

Alex Moshchuk

Good catch, I think capturing updates in NavigationRequest makes sense.

File content/browser/renderer_host/policy_container_host.h
Camille Lamy . resolved

I had to remove those checks because the NavigationRequest now sets itself as the client of the PolicyContainerHost prior to those being called. See comment in NavigationRequest for why. Since we're still requesting the NavigationPolicyContainerBuilder as a PassKey this is fine I think, as that means the PCH is not assigned to an RFH yet, so modifying browser process-only policies should be fine.

Alex Moshchuk

Acknowledged

File third_party/blink/public/mojom/frame/policy_container.mojom
Line 47, Patchset 7 (Latest):// `initiator_stat:w
Alex Moshchuk . unresolved

nit: broken comment

Open in Gerrit

Related details

Attention is currently required from:
  • Camille Lamy
  • Mike West
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I77f77b25be2ecfddf95f06488ef2f9e0e4081914
    Gerrit-Change-Number: 8156368
    Gerrit-PatchSet: 7
    Gerrit-Owner: Camille Lamy <cl...@chromium.org>
    Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Reviewer: Camille Lamy <cl...@chromium.org>
    Gerrit-Reviewer: Mike West <mk...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Daniel Cheng <dch...@chromium.org>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Fredrik Söderquist <f...@opera.com>
    Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
    Gerrit-CC: Mike Taylor <mike...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-CC: Victor Tan <vict...@chromium.org>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Mike West <mk...@chromium.org>
    Gerrit-Attention: Camille Lamy <cl...@chromium.org>
    Gerrit-Comment-Date: Fri, 31 Jul 2026 01:23:32 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Camille Lamy <cl...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages