[CSP]: Do not block same-document navigations. [chromium/src : main]

0 views
Skip to first unread message

Arthur Sonzogni (Gerrit)

unread,
Oct 28, 2021, 3:38:27 AM10/28/21
to Antonio Sartori, alexmo...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org, Camille Lamy, Mike West

Attention is currently required from: Antonio Sartori.

Arthur Sonzogni would like Antonio Sartori to review this change.

View Change

[CSP]: Do not block same-document navigations.

A cross-origin initiated same-document navigation caused crash when
blocked by CSP.

Stop blocking it + WPT regression test.

This is #9 Mac crasher on M95 stable. So expect M96 (beta) cherry-pick.
That's probably not enough for cherry-pick M95 (stable).

Bug:1262203
Change-Id: Ie70f77bd9ec69ac0659321f2e8e626b2bd091126
---
A third_party/blink/web_tests/external/wpt/content-security-policy/frame-src/frame-src-cross-origin-same-document-navigation.window.js
M content/browser/renderer_host/navigation_request.cc
2 files changed, 51 insertions(+), 0 deletions(-)


To view, visit change 3247135. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie70f77bd9ec69ac0659321f2e8e626b2bd091126
Gerrit-Change-Number: 3247135
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-Reviewer: Antonio Sartori <antonio...@chromium.org>
Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-CC: Camille Lamy <cl...@chromium.org>
Gerrit-CC: Mike West <mk...@chromium.org>
Gerrit-Attention: Antonio Sartori <antonio...@chromium.org>
Gerrit-MessageType: newchange

Arthur Sonzogni (Gerrit)

unread,
Oct 28, 2021, 3:38:33 AM10/28/21
to alexmo...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org, Antonio Sartori, Camille Lamy, Mike West, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Antonio Sartori.

View Change

1 comment:

To view, visit change 3247135. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie70f77bd9ec69ac0659321f2e8e626b2bd091126
Gerrit-Change-Number: 3247135
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-Reviewer: Antonio Sartori <antonio...@chromium.org>
Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-CC: Camille Lamy <cl...@chromium.org>
Gerrit-CC: Mike West <mk...@chromium.org>
Gerrit-Attention: Antonio Sartori <antonio...@chromium.org>
Gerrit-Comment-Date: Thu, 28 Oct 2021 07:38:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Blink WPT Bot (Gerrit)

unread,
Oct 28, 2021, 3:43:45 AM10/28/21
to Arthur Sonzogni, alexmo...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org, Antonio Sartori, Camille Lamy, Mike West, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Antonio Sartori.

Exportable changes to web-platform-tests were detected in this CL and a pull request in the upstream repo has been made: https://github.com/web-platform-tests/wpt/pull/31413.

When this CL lands, the bot will automatically merge the PR on GitHub if the required GitHub checks pass; otherwise, ecosystem-infra@ team will triage the failures and may contact you.

WPT Export docs:
https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md#Automatic-export-process

View Change

    To view, visit change 3247135. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie70f77bd9ec69ac0659321f2e8e626b2bd091126
    Gerrit-Change-Number: 3247135
    Gerrit-PatchSet: 1
    Gerrit-Owner: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-CC: Camille Lamy <cl...@chromium.org>
    Gerrit-CC: Mike West <mk...@chromium.org>
    Gerrit-Attention: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Comment-Date: Thu, 28 Oct 2021 07:43:29 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Antonio Sartori (Gerrit)

    unread,
    Oct 28, 2021, 4:43:15 AM10/28/21
    to Arthur Sonzogni, alexmo...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org, Blink WPT Bot, Camille Lamy, Mike West, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Arthur Sonzogni.

    Patch set 1:Code-Review +1

    View Change

    2 comments:

    • Patchset:

      • Patch Set #1:

        Thanks! LGTM, with a suggestion for improving the test. Since this is a fix for a crash which we'll probably want to merge back, it's fine to merge it as is, but I think it would be nice to extend the test in a follow up as I am proposing since that would ensure that browsers behave the same here.

    • File third_party/blink/web_tests/external/wpt/content-security-policy/frame-src/frame-src-cross-origin-same-document-navigation.window.js:

      • Patch Set #1, Line 29: await new Promise(resolve => test.step_timeout(resolve, 1500));

        I think it would be actually nice to check that the iframe navigated and CSP did not block anything. I suggest:

        1) checking from the iframe that the iframe navigated to the fragment
        2) adding a spv listener that fails the test

    To view, visit change 3247135. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie70f77bd9ec69ac0659321f2e8e626b2bd091126
    Gerrit-Change-Number: 3247135
    Gerrit-PatchSet: 1
    Gerrit-Owner: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-CC: Camille Lamy <cl...@chromium.org>
    Gerrit-CC: Mike West <mk...@chromium.org>
    Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Comment-Date: Thu, 28 Oct 2021 08:42:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Arthur Sonzogni (Gerrit)

    unread,
    Oct 28, 2021, 6:29:21 AM10/28/21
    to alexmo...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org, Antonio Sartori, Blink WPT Bot, Camille Lamy, Mike West, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Antonio Sartori.

    View Change

    1 comment:

    • File third_party/blink/web_tests/external/wpt/content-security-policy/frame-src/frame-src-cross-origin-same-document-navigation.window.js:

      • I think it would be actually nice to check that the iframe navigated and CSP did not block anything. […]

        Good idea! Done.

    To view, visit change 3247135. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie70f77bd9ec69ac0659321f2e8e626b2bd091126
    Gerrit-Change-Number: 3247135
    Gerrit-PatchSet: 3
    Gerrit-Owner: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-CC: Camille Lamy <cl...@chromium.org>
    Gerrit-CC: Mike West <mk...@chromium.org>
    Gerrit-Attention: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Comment-Date: Thu, 28 Oct 2021 10:29:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Antonio Sartori <antonio...@chromium.org>
    Gerrit-MessageType: comment

    Arthur Sonzogni (Gerrit)

    unread,
    Oct 28, 2021, 6:31:50 AM10/28/21
    to alexmo...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org, Antonio Sartori, Blink WPT Bot, Camille Lamy, Mike West, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Antonio Sartori.

    Arthur Sonzogni removed a vote from this change.

    View Change

    Removed Code-Review+1 by Antonio Sartori <antonio...@chromium.org>

    To view, visit change 3247135. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie70f77bd9ec69ac0659321f2e8e626b2bd091126
    Gerrit-Change-Number: 3247135
    Gerrit-PatchSet: 3
    Gerrit-Owner: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-CC: Camille Lamy <cl...@chromium.org>
    Gerrit-CC: Mike West <mk...@chromium.org>
    Gerrit-Attention: Antonio Sartori <antonio...@chromium.org>
    Gerrit-MessageType: deleteVote

    Arthur Sonzogni (Gerrit)

    unread,
    Oct 28, 2021, 6:32:06 AM10/28/21
    to alexmo...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org, Antonio Sartori, Blink WPT Bot, Camille Lamy, Mike West, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Antonio Sartori.

    View Change

    1 comment:

    • Patchset:

      • Patch Set #1:

        Thanks! LGTM, with a suggestion for improving the test. […]

        Ooops, I didn't realized you wanted it for a follow-up. I did it here. Could you please take another look?

    To view, visit change 3247135. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie70f77bd9ec69ac0659321f2e8e626b2bd091126
    Gerrit-Change-Number: 3247135
    Gerrit-PatchSet: 3
    Gerrit-Owner: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-CC: Camille Lamy <cl...@chromium.org>
    Gerrit-CC: Mike West <mk...@chromium.org>
    Gerrit-Attention: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Comment-Date: Thu, 28 Oct 2021 10:31:50 +0000

    Antonio Sartori (Gerrit)

    unread,
    Oct 28, 2021, 7:30:19 AM10/28/21
    to Arthur Sonzogni, alexmo...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org, Blink WPT Bot, Camille Lamy, Mike West, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Arthur Sonzogni.

    Patch set 3:Code-Review +1

    View Change

    8 comments:

    • Patchset:

    • File third_party/blink/web_tests/external/wpt/content-security-policy/frame-src/frame-src-cross-origin-same-document-navigation.window.js:

      • Good idea! Done.

        Thanks. Why don't you remove this blind timeout and instead use test.step_wait on the condition that await child.execute_script(() => windoc.counter) returns 1?

    • File third_party/blink/web_tests/external/wpt/content-security-policy/frame-src/frame-src-cross-origin-same-document-navigation.window.js:

    • File third_party/blink/web_tests/external/wpt/content-security-policy/frame-src/support/executor.html:

    To view, visit change 3247135. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie70f77bd9ec69ac0659321f2e8e626b2bd091126
    Gerrit-Change-Number: 3247135
    Gerrit-PatchSet: 3
    Gerrit-Owner: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-CC: Camille Lamy <cl...@chromium.org>
    Gerrit-CC: Mike West <mk...@chromium.org>
    Gerrit-Attention: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Comment-Date: Thu, 28 Oct 2021 11:30:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Antonio Sartori <antonio...@chromium.org>
    Comment-In-Reply-To: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-MessageType: comment

    Arthur Sonzogni (Gerrit)

    unread,
    Oct 28, 2021, 10:43:02 AM10/28/21
    to alexmo...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org, Antonio Sartori, Blink WPT Bot, Camille Lamy, Mike West, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Antonio Sartori.

    Patch set 5:Commit-Queue +2

    View Change

    9 comments:

    • Patchset:

    • File third_party/blink/web_tests/external/wpt/content-security-policy/frame-src/frame-src-cross-origin-same-document-navigation.window.js:

      • Thanks. Why don't you remove this blind timeout and instead use test. […]

        I went with a promise instead of a waiting loop.

    • File third_party/blink/web_tests/external/wpt/content-security-policy/frame-src/frame-src-cross-origin-same-document-navigation.window.js:

      • Done

      • Done

      • Done

      • Done

      • doesn't just `document. […]

        Done

      • Done

    • File third_party/blink/web_tests/external/wpt/content-security-policy/frame-src/support/executor.html:

      • Done

    To view, visit change 3247135. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie70f77bd9ec69ac0659321f2e8e626b2bd091126
    Gerrit-Change-Number: 3247135
    Gerrit-PatchSet: 5
    Gerrit-Owner: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-CC: Camille Lamy <cl...@chromium.org>
    Gerrit-CC: Mike West <mk...@chromium.org>
    Gerrit-Attention: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Comment-Date: Thu, 28 Oct 2021 14:42:52 +0000

    Chromium LUCI CQ (Gerrit)

    unread,
    Oct 28, 2021, 12:23:50 PM10/28/21
    to Arthur Sonzogni, alexmo...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org, Antonio Sartori, Blink WPT Bot, Camille Lamy, Mike West, chromium...@chromium.org

    Chromium LUCI CQ submitted this change.

    View Change



    3 is the latest approved patch-set.
    The change was submitted with unreviewed changes in the following files:

    ```
    The name of the file: third_party/blink/web_tests/external/wpt/content-security-policy/frame-src/frame-src-cross-origin-same-document-navigation.window.js
    Insertions: 9, Deletions: 10.

    The diff is too large to show. Please review the diff.
    ```
    ```
    The name of the file: third_party/blink/web_tests/external/wpt/content-security-policy/frame-src/support/executor.html
    Insertions: 1, Deletions: 1.

    The diff is too large to show. Please review the diff.
    ```

    Approvals: Antonio Sartori: Looks good to me Arthur Sonzogni: Commit
    [CSP]: Do not block same-document navigations.

    A cross-origin initiated same-document navigation caused crash when
    blocked by CSP.

    Stop blocking it + WPT regression test.

    This is #9 Mac crasher on M95 stable. So expect M96 (beta) cherry-pick.
    That's probably not enough for cherry-pick M95 (stable).

    Bug: 1262203
    Change-Id: Ie70f77bd9ec69ac0659321f2e8e626b2bd091126
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3247135
    Commit-Queue: Arthur Sonzogni <arthurs...@chromium.org>
    Reviewed-by: Antonio Sartori <antonio...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#935920}
    ---
    A third_party/blink/web_tests/external/wpt/content-security-policy/frame-src/support/executor.html
    A third_party/blink/web_tests/external/wpt/content-security-policy/frame-src/frame-src-cross-origin-same-document-navigation.window.js
    M content/browser/renderer_host/navigation_request.cc
    3 files changed, 81 insertions(+), 0 deletions(-)


    To view, visit change 3247135. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie70f77bd9ec69ac0659321f2e8e626b2bd091126
    Gerrit-Change-Number: 3247135
    Gerrit-PatchSet: 6
    Gerrit-Owner: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Antonio Sartori <antonio...@chromium.org>
    Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-CC: Camille Lamy <cl...@chromium.org>
    Gerrit-CC: Mike West <mk...@chromium.org>
    Gerrit-MessageType: merged

    Blink WPT Bot (Gerrit)

    unread,
    Oct 28, 2021, 12:47:28 PM10/28/21
    to Arthur Sonzogni, Chromium LUCI CQ, alexmo...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, creis...@chromium.org, navigation...@chromium.org, Antonio Sartori, Camille Lamy, Mike West, chromium...@chromium.org

    The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/31413

    View Change

      To view, visit change 3247135. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ie70f77bd9ec69ac0659321f2e8e626b2bd091126
      Gerrit-Change-Number: 3247135
      Gerrit-PatchSet: 6
      Gerrit-Owner: Arthur Sonzogni <arthurs...@chromium.org>
      Gerrit-Reviewer: Antonio Sartori <antonio...@chromium.org>
      Gerrit-Reviewer: Arthur Sonzogni <arthurs...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
      Gerrit-CC: Camille Lamy <cl...@chromium.org>
      Gerrit-CC: Mike West <mk...@chromium.org>
      Gerrit-Comment-Date: Thu, 28 Oct 2021 16:47:11 +0000
      Reply all
      Reply to author
      Forward
      0 new messages