[Streams] Verify stream usage within the same isolated world [chromium/src : main]

0 views
Skip to first unread message

Adam Rice (Gerrit)

unread,
Jun 12, 2026, 3:37:30 AMJun 12
to Nidhi Jaju, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, ricea...@chromium.org
Attention needed from Nidhi Jaju

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Nidhi Jaju
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I7fbe0788181c84c6138dc2413b747dbbdfa767e2
Gerrit-Change-Number: 7917395
Gerrit-PatchSet: 5
Gerrit-Owner: Adam Rice <ri...@chromium.org>
Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
Gerrit-Reviewer: Nidhi Jaju <nidh...@chromium.org>
Gerrit-Attention: Nidhi Jaju <nidh...@chromium.org>
Gerrit-Comment-Date: Fri, 12 Jun 2026 07:37:06 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Nidhi Jaju (Gerrit)

unread,
Jun 15, 2026, 2:28:31 AMJun 15
to Adam Rice, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, ricea...@chromium.org
Attention needed from Adam Rice

Nidhi Jaju voted and added 3 comments

Votes added by Nidhi Jaju

Code-Review+1

3 comments

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Nidhi Jaju . resolved

lgtm % nits

File third_party/blink/renderer/core/streams/readable_stream.h
Line 9, Patchset 5 (Latest):
Nidhi Jaju . unresolved

I'm not sure we need a blank line here.

File third_party/blink/renderer/core/streams/readable_stream.cc
Line 368, Patchset 5 (Latest): stream->DCheckWrapperWorld(script_state);
Nidhi Jaju . unresolved

Is this a sufficient fix for non-debug builds?

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Rice
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: I7fbe0788181c84c6138dc2413b747dbbdfa767e2
    Gerrit-Change-Number: 7917395
    Gerrit-PatchSet: 5
    Gerrit-Owner: Adam Rice <ri...@chromium.org>
    Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
    Gerrit-Reviewer: Nidhi Jaju <nidh...@chromium.org>
    Gerrit-Attention: Adam Rice <ri...@chromium.org>
    Gerrit-Comment-Date: Mon, 15 Jun 2026 06:27:57 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Adam Rice (Gerrit)

    unread,
    Jun 29, 2026, 4:24:19 AM (11 days ago) Jun 29
    to Nidhi Jaju, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, ricea...@chromium.org
    Attention needed from Nidhi Jaju

    Adam Rice added 1 comment

    File third_party/blink/renderer/core/streams/readable_stream.cc
    Line 368, Patchset 5 (Latest): stream->DCheckWrapperWorld(script_state);
    Nidhi Jaju . unresolved

    Is this a sufficient fix for non-debug builds?

    Adam Rice

    I've concluded that it isn't. We don't typically write tests involving the interaction of the same API in extensions and the main page. Problems are only likely to show up in release builds. I am going to redo this.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Nidhi Jaju
    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: I7fbe0788181c84c6138dc2413b747dbbdfa767e2
    Gerrit-Change-Number: 7917395
    Gerrit-PatchSet: 5
    Gerrit-Owner: Adam Rice <ri...@chromium.org>
    Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
    Gerrit-Reviewer: Nidhi Jaju <nidh...@chromium.org>
    Gerrit-Attention: Nidhi Jaju <nidh...@chromium.org>
    Gerrit-Comment-Date: Mon, 29 Jun 2026 08:23:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Nidhi Jaju <nidh...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Nidhi Jaju (Gerrit)

    unread,
    Jul 5, 2026, 11:30:35 PM (4 days ago) Jul 5
    to Adam Rice, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, ricea...@chromium.org
    Attention needed from Adam Rice

    Nidhi Jaju voted and added 1 comment

    Votes added by Nidhi Jaju

    Code-Review+0

    1 comment

    File third_party/blink/renderer/core/streams/readable_stream.cc
    Line 368, Patchset 5 (Latest): stream->DCheckWrapperWorld(script_state);
    Nidhi Jaju . unresolved

    Is this a sufficient fix for non-debug builds?

    Adam Rice

    I've concluded that it isn't. We don't typically write tests involving the interaction of the same API in extensions and the main page. Problems are only likely to show up in release builds. I am going to redo this.

    Nidhi Jaju

    Let me unset my attention set then while you're reworking the CL.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Adam Rice
    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: I7fbe0788181c84c6138dc2413b747dbbdfa767e2
      Gerrit-Change-Number: 7917395
      Gerrit-PatchSet: 5
      Gerrit-Owner: Adam Rice <ri...@chromium.org>
      Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
      Gerrit-Reviewer: Nidhi Jaju <nidh...@chromium.org>
      Gerrit-Attention: Adam Rice <ri...@chromium.org>
      Gerrit-Comment-Date: Mon, 06 Jul 2026 03:30:24 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Nidhi Jaju <nidh...@chromium.org>
      Comment-In-Reply-To: Adam Rice <ri...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Adam Rice (Gerrit)

      unread,
      Jul 9, 2026, 2:01:03 PM (17 hours ago) Jul 9
      to Nidhi Jaju, Chromium LUCI CQ, chromium...@chromium.org, blink-...@chromium.org, ricea...@chromium.org
      Attention needed from Nidhi Jaju

      Adam Rice voted and added 2 comments

      Votes added by Adam Rice

      Commit-Queue+1

      2 comments

      File third_party/blink/renderer/core/streams/readable_stream.h
      Line 9, Patchset 5:
      Nidhi Jaju . resolved

      I'm not sure we need a blank line here.

      Adam Rice

      This is actually in the style guide. From https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
      ```
      In dir/foo.cc or dir/foo_test.cc, whose main purpose is to implement or test
      the stuff in dir2/foo2.h, order your includes as follows:

      1. dir2/foo2.h.
      2. A blank line
      3. C system headers, and any other headers in angle brackets with the .h
      extension, e.g., <unistd.h>, <stdlib.h>, <Python.h>.
      4. A blank line
      5. C++ standard library headers (without file extension), e.g., <algorithm>
      <cstddef>.
      6. A blank line
      7. Other libraries' .h files.
      8. A blank line
      9. Your project's .h files.
      ```

      I actually never noticed rule 8 and haven't followed it. But rule 4 is generally followed in Chromium I think.

      File third_party/blink/renderer/core/streams/readable_stream.cc
      Line 368, Patchset 5: stream->DCheckWrapperWorld(script_state);
      Nidhi Jaju . resolved

      Is this a sufficient fix for non-debug builds?

      Adam Rice

      I've concluded that it isn't. We don't typically write tests involving the interaction of the same API in extensions and the main page. Problems are only likely to show up in release builds. I am going to redo this.

      Nidhi Jaju

      Let me unset my attention set then while you're reworking the CL.

      Adam Rice

      Okay, I have changed it to use CHECK now.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Nidhi Jaju
      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: I7fbe0788181c84c6138dc2413b747dbbdfa767e2
      Gerrit-Change-Number: 7917395
      Gerrit-PatchSet: 7
      Gerrit-Owner: Adam Rice <ri...@chromium.org>
      Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
      Gerrit-Reviewer: Nidhi Jaju <nidh...@chromium.org>
      Gerrit-Attention: Nidhi Jaju <nidh...@chromium.org>
      Gerrit-Comment-Date: Thu, 09 Jul 2026 18:00:27 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Nidhi Jaju (Gerrit)

      unread,
      1:46 AM (6 hours ago) 1:46 AM
      to Adam Rice, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, storage...@chromium.org, blink-...@chromium.org, ricea...@chromium.org
      Attention needed from Adam Rice

      Nidhi Jaju added 1 comment

      File third_party/blink/renderer/core/streams/readable_stream.cc
      Line 496, Patchset 7 (Latest): CHECK_EQ(wrapper_world_id_, script_state->World().GetWorldId());
      Nidhi Jaju . unresolved

      Is it fine to trigger a crash if this is violated since a malicious script could intentionally pass a stream across this boundary and call `.cancel()`? I'm wondering if we should instead throw an exception instead at least for the web-exposed API entry points?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adam Rice
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not 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: I7fbe0788181c84c6138dc2413b747dbbdfa767e2
        Gerrit-Change-Number: 7917395
        Gerrit-PatchSet: 7
        Gerrit-Owner: Adam Rice <ri...@chromium.org>
        Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
        Gerrit-Reviewer: Nidhi Jaju <nidh...@chromium.org>
        Gerrit-Attention: Adam Rice <ri...@chromium.org>
        Gerrit-Comment-Date: Fri, 10 Jul 2026 05:46:00 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Adam Rice (Gerrit)

        unread,
        6:02 AM (1 hour ago) 6:02 AM
        to android-bu...@system.gserviceaccount.com, Nidhi Jaju, Chromium LUCI CQ, chromium...@chromium.org, storage...@chromium.org, blink-...@chromium.org, ricea...@chromium.org
        Attention needed from Nidhi Jaju

        Adam Rice added 1 comment

        File third_party/blink/renderer/core/streams/readable_stream.cc
        Line 496, Patchset 7 (Latest): CHECK_EQ(wrapper_world_id_, script_state->World().GetWorldId());
        Nidhi Jaju . resolved

        Is it fine to trigger a crash if this is violated since a malicious script could intentionally pass a stream across this boundary and call `.cancel()`? I'm wondering if we should instead throw an exception instead at least for the web-exposed API entry points?

        Adam Rice

        If there is a way to pass a stream object to a different isolated world that would already be a security bug by itself. Crashing in that case is the safe thing to do.

        `postMessage` is not a problem, because in that case the stream in the destination realm is not actually the same C++ object.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Nidhi Jaju
        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: I7fbe0788181c84c6138dc2413b747dbbdfa767e2
          Gerrit-Change-Number: 7917395
          Gerrit-PatchSet: 7
          Gerrit-Owner: Adam Rice <ri...@chromium.org>
          Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
          Gerrit-Reviewer: Nidhi Jaju <nidh...@chromium.org>
          Gerrit-Attention: Nidhi Jaju <nidh...@chromium.org>
          Gerrit-Comment-Date: Fri, 10 Jul 2026 10:02:16 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Nidhi Jaju <nidh...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Nidhi Jaju (Gerrit)

          unread,
          6:04 AM (1 hour ago) 6:04 AM
          to Adam Rice, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, storage...@chromium.org, blink-...@chromium.org, ricea...@chromium.org
          Attention needed from Adam Rice

          Nidhi Jaju voted Code-Review+1

          Code-Review+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Adam Rice
          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: I7fbe0788181c84c6138dc2413b747dbbdfa767e2
            Gerrit-Change-Number: 7917395
            Gerrit-PatchSet: 7
            Gerrit-Owner: Adam Rice <ri...@chromium.org>
            Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
            Gerrit-Reviewer: Nidhi Jaju <nidh...@chromium.org>
            Gerrit-Attention: Adam Rice <ri...@chromium.org>
            Gerrit-Comment-Date: Fri, 10 Jul 2026 10:04:18 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages