[Connection-Allowlist] Enforce for FedCM API [chromium/src : main]

0 views
Skip to first unread message

Xiaochen Zhou (Gerrit)

unread,
Jun 9, 2026, 11:17:18 AMJun 9
to Andrew Verge, Shivani Sharma, Mike West, Noam Rosenthal, Chromium LUCI CQ, Christian Biesinger, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, loading...@chromium.org, npm+...@chromium.org, yigu+...@chromium.org
Attention needed from Andrew Verge

Xiaochen Zhou added 1 comment

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Xiaochen Zhou . resolved

+averge@ for a first pass, thank you

Open in Gerrit

Related details

Attention is currently required from:
  • Andrew Verge
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • 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: Ib45d32bd80b21f00e171ed539f095502d5d6b91b
Gerrit-Change-Number: 7907707
Gerrit-PatchSet: 9
Gerrit-Owner: Xiaochen Zhou <xiaoc...@chromium.org>
Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
Gerrit-CC: Mike West <mk...@chromium.org>
Gerrit-CC: Noam Rosenthal <nrose...@google.com>
Gerrit-CC: Shivani Sharma <shiva...@chromium.org>
Gerrit-Attention: Andrew Verge <ave...@chromium.org>
Gerrit-Comment-Date: Tue, 09 Jun 2026 15:17:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andrew Verge (Gerrit)

unread,
Jun 10, 2026, 11:00:20 PM (14 days ago) Jun 10
to Xiaochen Zhou, Shivani Sharma, Mike West, Noam Rosenthal, Chromium LUCI CQ, Christian Biesinger, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, loading...@chromium.org, npm+...@chromium.org, yigu+...@chromium.org
Attention needed from Xiaochen Zhou

Andrew Verge voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Xiaochen Zhou
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • 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: Ib45d32bd80b21f00e171ed539f095502d5d6b91b
    Gerrit-Change-Number: 7907707
    Gerrit-PatchSet: 9
    Gerrit-Owner: Xiaochen Zhou <xiaoc...@chromium.org>
    Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
    Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
    Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
    Gerrit-CC: Mike West <mk...@chromium.org>
    Gerrit-CC: Noam Rosenthal <nrose...@google.com>
    Gerrit-CC: Shivani Sharma <shiva...@chromium.org>
    Gerrit-Attention: Xiaochen Zhou <xiaoc...@chromium.org>
    Gerrit-Comment-Date: Thu, 11 Jun 2026 03:00:07 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Xiaochen Zhou (Gerrit)

    unread,
    Jun 11, 2026, 11:00:44 AM (13 days ago) Jun 11
    to Christian Biesinger, Andrew Verge, Shivani Sharma, Mike West, Noam Rosenthal, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, loading...@chromium.org, npm+...@chromium.org, yigu+...@chromium.org
    Attention needed from Christian Biesinger

    Xiaochen Zhou added 1 comment

    Patchset-level comments
    Xiaochen Zhou . resolved
    +cbiesinger@ for 
    * code review as FedCM API owner for
    * chrome/test/chromedriver/
    * content/browser/webid/
    * owner approval of
    * content/browser/webid/
    * VirtualTestSuites

    Thank you.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Christian Biesinger
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • 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: Ib45d32bd80b21f00e171ed539f095502d5d6b91b
    Gerrit-Change-Number: 7907707
    Gerrit-PatchSet: 9
    Gerrit-Owner: Xiaochen Zhou <xiaoc...@chromium.org>
    Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
    Gerrit-Reviewer: Christian Biesinger <cbies...@chromium.org>
    Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
    Gerrit-CC: Mike West <mk...@chromium.org>
    Gerrit-CC: Noam Rosenthal <nrose...@google.com>
    Gerrit-CC: Shivani Sharma <shiva...@chromium.org>
    Gerrit-Attention: Christian Biesinger <cbies...@chromium.org>
    Gerrit-Comment-Date: Thu, 11 Jun 2026 15:00:23 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Xiaochen Zhou (Gerrit)

    unread,
    Jun 15, 2026, 5:05:52 PM (9 days ago) Jun 15
    to Yi Gu, Andrew Verge, Shivani Sharma, Mike West, Noam Rosenthal, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, loading...@chromium.org, npm+...@chromium.org, yigu+...@chromium.org
    Attention needed from Yi Gu

    Xiaochen Zhou added 1 comment

    Patchset-level comments
    Xiaochen Zhou . resolved

    +yigu@ for code review as FedCM API owner for

    • chrome/test/chromedriver/
    • content/browser/webid/

    and also owner approval of

    • content/browser/webid/

    Thank you.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Yi Gu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • 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: Ib45d32bd80b21f00e171ed539f095502d5d6b91b
    Gerrit-Change-Number: 7907707
    Gerrit-PatchSet: 9
    Gerrit-Owner: Xiaochen Zhou <xiaoc...@chromium.org>
    Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
    Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
    Gerrit-Reviewer: Yi Gu <yi...@chromium.org>
    Gerrit-CC: Mike West <mk...@chromium.org>
    Gerrit-CC: Noam Rosenthal <nrose...@google.com>
    Gerrit-CC: Shivani Sharma <shiva...@chromium.org>
    Gerrit-Attention: Yi Gu <yi...@chromium.org>
    Gerrit-Comment-Date: Mon, 15 Jun 2026 21:05:36 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yi Gu (Gerrit)

    unread,
    Jun 15, 2026, 5:45:31 PM (9 days ago) Jun 15
    to Xiaochen Zhou, Andrew Verge, Shivani Sharma, Mike West, Noam Rosenthal, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, loading...@chromium.org, npm+...@chromium.org, yigu+...@chromium.org
    Attention needed from Xiaochen Zhou

    Yi Gu added 4 comments

    File content/browser/webid/network_request_manager.cc
    Line 165, Patchset 9 (Latest): FrameTreeNode* node = FrameTreeNode::GloballyFindByID(frame_tree_node_id_);
    Yi Gu . unresolved

    Q: how does the connection allowlist work for cross-origin/site iframes?

    Line 168, Patchset 9 (Latest): node->current_frame_host()->policy_container_host()->policies(),
    Yi Gu . unresolved

    This could be null during teardown etc. Should we check for nullptr first?

    Line 175, Patchset 9 (Latest): return;
    Yi Gu . unresolved

    This early return makes devtools be unaware of the failure. See line 191 below.

    Line 165, Patchset 9 (Latest): FrameTreeNode* node = FrameTreeNode::GloballyFindByID(frame_tree_node_id_);
    if (node && node->current_frame_host() &&
    !ConnectionAllowlistAllowsUrlAndReportIfNeeded(
    node->current_frame_host()->policy_container_host()->policies(),
    resource_request->url)) {
    if (callback) {
    std::move(callback).Run(/*response_body=*/std::nullopt,
    net::ERR_NETWORK_ACCESS_REVOKED, /*mime_type=*/"",
    /*cors_error=*/false);
    }
    return;
    }
    Yi Gu . unresolved

    Could you leave some comments briefly explaining about why we are checking this?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Xiaochen Zhou
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not 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: Ib45d32bd80b21f00e171ed539f095502d5d6b91b
      Gerrit-Change-Number: 7907707
      Gerrit-PatchSet: 9
      Gerrit-Owner: Xiaochen Zhou <xiaoc...@chromium.org>
      Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
      Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
      Gerrit-Reviewer: Yi Gu <yi...@chromium.org>
      Gerrit-CC: Mike West <mk...@chromium.org>
      Gerrit-CC: Noam Rosenthal <nrose...@google.com>
      Gerrit-CC: Shivani Sharma <shiva...@chromium.org>
      Gerrit-Attention: Xiaochen Zhou <xiaoc...@chromium.org>
      Gerrit-Comment-Date: Mon, 15 Jun 2026 21:45:19 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Christian Biesinger (Gerrit)

      unread,
      Jun 16, 2026, 5:17:08 AM (8 days ago) Jun 16
      to Xiaochen Zhou, Christian Biesinger, Yi Gu, Andrew Verge, Shivani Sharma, Mike West, Noam Rosenthal, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, loading...@chromium.org, npm+...@chromium.org, yigu+...@chromium.org
      Attention needed from Xiaochen Zhou

      Christian Biesinger added 22 comments

      File chrome/test/chromedriver/fedcm_commands.cc
      Line 68, Patchset 9 (Latest): // Dialog due to token fetch failure), the dialog should not be marked closed.
      Christian Biesinger . unresolved

      Most fetch failures are asynchronous, so IMO it would be better to be more explicit here, something like `due to a synchronous token fetch failure such as a connection-allowlist block`

      File content/browser/loader/connection_allowlist_browsertest.cc
      Line 2991, Patchset 9 (Latest): base::test::ScopedFeatureList fedcm_feature_list_{features::kFedCm};
      Christian Biesinger . unresolved

      this isn't really necessary, fedcm has been enabled by default for years

      Line 2994, Patchset 9 (Latest):// FedCM API's fetch to "https://<configURL-host>/.well-known/web-identity"
      Christian Biesinger . unresolved

      host -> site (or eTLD+1)

      Line 3010, Patchset 9 (Latest): // `URLLoaderInterceptor` is required. `RegisterResponse` cannot be used. This
      Christian Biesinger . unresolved
      Line 3033, Patchset 9 (Latest): // Since the complete FedCM flow is not mocked, the FedCM API failed with the
      Christian Biesinger . unresolved

      Rather, FedCM avoids exposing specific errors the website, so all failures lead to "Error retrieving a token"

      Line 3058, Patchset 9 (Latest): R"((response-origin "*://b.test:*/.well-known/web-identity"))"}}));
      Christian Biesinger . unresolved

      So, if I am interpreting this correctly, then only the well known file itself is allowlisted. This means that the /fedcm.json file is not allowlisted, and so this test should still fail with net::ERR_NETWORK_ACCESS_REVOKED?

      Line 3109, Patchset 9 (Latest):// is allowed by the connection allowlist. The response directs FedCM to fetch
      Christian Biesinger . unresolved

      That's not how fedcm works. Instead, if the well known file contains a different URL for the config file, we fail with a mismatch error; we never attempt to fetch that different URL

      Line 3182, Patchset 9 (Latest):// FedCM API's fetch to "https://<configURL-host>/.well-known/web-identity"
      Christian Biesinger . unresolved

      The fetch is made to the root domain of configURL's site (b.test) and not to the hostname (sub.b.test), which matches what your test expects but not what the comment says.

      Line 3184, Patchset 9 (Latest):// the config fedcm.json using another URL, which is also allowed.
      Christian Biesinger . unresolved

      again that is not how FedCM works and your test does request the file using `sub.b.test` as the initial configURL

      Line 3267, Patchset 9 (Latest): manager->FetchClientMetadata(GURL("https://b.test/client_metadata"),
      Christian Biesinger . unresolved

      Add a comment like `We fetch the client metadata endpoint directly using the network request manager because client metadata errors are not fatal during the FedCM flow`

      Line 3284, Patchset 9 (Latest): "client_id", 1, 1, base::DoNothing());
      Christian Biesinger . unresolved

      why not use a similar TestFuture like in ClientMetadataBlocked?

      Line 3301, Patchset 9 (Latest): manager->SendAccountsRequest(url::Origin::Create(GURL("https://b.test")),
      Christian Biesinger . unresolved

      Why are you calling this directly instead of using the regular FedCM flow like in the well known tests? (Or conversely, why are you using the regular fedcm flow in those tests?)

      Line 3318, Patchset 9 (Latest): manager->SendAccountsRequest(url::Origin::Create(GURL("https://b.test")),
      Christian Biesinger . unresolved

      If you want to call this directly, why not use TestFuture to check that it actually works completely? Alternatively, why not use the regular fedcm flow? (Are you trying to avoid dealing with the dialog?)

      Line 3337, Patchset 9 (Latest): manager->SendTokenRequest(
      Christian Biesinger . unresolved

      same question re: fedcm flow

      Line 3355, Patchset 9 (Latest): manager->SendTokenRequest(
      Christian Biesinger . unresolved

      same question re: TestFuture/fedcm flow

      Line 3391, Patchset 9 (Latest): manager->DownloadAndDecodeImage(GURL("https://b.test/image.png"),
      Christian Biesinger . resolved

      I'm OK with this one because doing something else would require having valid image data in the test which seems not worth it.

      Line 3432, Patchset 9 (Latest):IN_PROC_BROWSER_TEST_F(ConnectionAllowlistFedCmTest, RedirectToBlocked) {
      Christian Biesinger . unresolved

      this does not actually test redirect_to. it just tests the token request. was this written by AI?

      Line 3451, Patchset 9 (Latest):IN_PROC_BROWSER_TEST_F(ConnectionAllowlistFedCmTest, RedirectToAllowed) {
      Christian Biesinger . unresolved

      same here

      Line 3480, Patchset 9 (Latest): manager->SendDisconnectRequest(GURL("https://b.test/disconnect"),
      Christian Biesinger . unresolved

      you probably could switch the disconnect tests to using JS `IdentityProvider.disconnect`, although you'd have to set up an account connection first, so maybe not worth it. but add a comment about why you're not doing that?

      Line 3515, Patchset 9 (Latest): manager->SendLogout(GURL("https://b.test/logout"), future.GetCallback());
      Christian Biesinger . resolved

      I didn't realize this function still exists... we should remove it, it has no callers.

      File content/browser/webid/network_request_manager.cc
      Line 165, Patchset 9 (Latest): FrameTreeNode* node = FrameTreeNode::GloballyFindByID(frame_tree_node_id_);
      Christian Biesinger . unresolved

      I think I would prefer remembering the render_frame_host in the constructor

      File third_party/blink/web_tests/external/wpt/connection-allowlist/tentative/fed_cm_token_blocked.https.sub.html
      Christian Biesinger . unresolved

      is there a reason you're not testing the accounts endpoint with a WPT test as well?

      (btw, why test the same thing in browser tests if you already have WPT tests?)

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Xiaochen Zhou
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not 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: Ib45d32bd80b21f00e171ed539f095502d5d6b91b
      Gerrit-Change-Number: 7907707
      Gerrit-PatchSet: 9
      Gerrit-Owner: Xiaochen Zhou <xiaoc...@chromium.org>
      Gerrit-Reviewer: Andrew Verge <ave...@chromium.org>
      Gerrit-Reviewer: Xiaochen Zhou <xiaoc...@chromium.org>
      Gerrit-Reviewer: Yi Gu <yi...@chromium.org>
      Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
      Gerrit-CC: Mike West <mk...@chromium.org>
      Gerrit-CC: Noam Rosenthal <nrose...@google.com>
      Gerrit-CC: Shivani Sharma <shiva...@chromium.org>
      Gerrit-Attention: Xiaochen Zhou <xiaoc...@chromium.org>
      Gerrit-Comment-Date: Tue, 16 Jun 2026 09:16:48 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages