Restrict origins for HLS keys [chromium/src : main]

0 views
Skip to first unread message

Dale Curtis (Gerrit)

unread,
Mar 31, 2026, 10:35:23 PM (2 days ago) Mar 31
to Ted (Chromium) Meyer, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org
Attention needed from Ted (Chromium) Meyer

Dale Curtis added 1 comment

File media/formats/hls/media_playlist.cc
Line 253, Patchset 3 (Latest): } else if (declared_uri_value != resource_uri.spec()) {
Dale Curtis . unresolved

(1) I don't understand how this ensures the url is path-only; a comment would be helpful.

(2) I think this will be brittle, but we can't use SecurityOrigin since it's in blink. Is there someway this code could query up to the WebMediaPlayer instance?

Open in Gerrit

Related details

Attention is currently required from:
  • Ted (Chromium) Meyer
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: Id54803fc48b8417ab31e1041f15f0e3acb6225b6
Gerrit-Change-Number: 7718533
Gerrit-PatchSet: 3
Gerrit-Owner: Ted (Chromium) Meyer <tmath...@chromium.org>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Ted (Chromium) Meyer <tmath...@chromium.org>
Gerrit-Attention: Ted (Chromium) Meyer <tmath...@chromium.org>
Gerrit-Comment-Date: Wed, 01 Apr 2026 02:35:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Ted (Chromium) Meyer (Gerrit)

unread,
Apr 1, 2026, 4:16:51 PM (yesterday) Apr 1
to Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org
Attention needed from Dale Curtis

Ted (Chromium) Meyer added 1 comment

File media/formats/hls/media_playlist.cc
Line 253, Patchset 3 (Latest): } else if (declared_uri_value != resource_uri.spec()) {
Dale Curtis . resolved

(1) I don't understand how this ensures the url is path-only; a comment would be helpful.

(2) I think this will be brittle, but we can't use SecurityOrigin since it's in blink. Is there someway this code could query up to the WebMediaPlayer instance?

Ted (Chromium) Meyer

for (1), yeah I'll add a comment. for (2), we specifically do not want to compare to the security origin for this, but rather to the origin of the manifest. The manifest itself might be CORS for the page. there's more of a writeup for why in the linked bug.

Open in Gerrit

Related details

Attention is currently required from:
  • Dale Curtis
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: Id54803fc48b8417ab31e1041f15f0e3acb6225b6
    Gerrit-Change-Number: 7718533
    Gerrit-PatchSet: 3
    Gerrit-Owner: Ted (Chromium) Meyer <tmath...@chromium.org>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Ted (Chromium) Meyer <tmath...@chromium.org>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Comment-Date: Wed, 01 Apr 2026 20:16:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dale Curtis (Gerrit)

    unread,
    Apr 1, 2026, 4:30:38 PM (yesterday) Apr 1
    to Ted (Chromium) Meyer, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org
    Attention needed from Ted (Chromium) Meyer

    Dale Curtis voted and added 1 comment

    Votes added by Dale Curtis

    Code-Review+1

    1 comment

    File media/formats/hls/media_playlist.cc
    Line 55, Patchset 4 (Latest): GURL uri,
    Dale Curtis . unresolved

    Can we rename this to playlist_uri?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ted (Chromium) Meyer
    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: Id54803fc48b8417ab31e1041f15f0e3acb6225b6
      Gerrit-Change-Number: 7718533
      Gerrit-PatchSet: 4
      Gerrit-Owner: Ted (Chromium) Meyer <tmath...@chromium.org>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Ted (Chromium) Meyer <tmath...@chromium.org>
      Gerrit-Attention: Ted (Chromium) Meyer <tmath...@chromium.org>
      Gerrit-Comment-Date: Wed, 01 Apr 2026 20:30:28 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Ted (Chromium) Meyer (Gerrit)

      unread,
      Apr 1, 2026, 5:09:56 PM (yesterday) Apr 1
      to Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org

      Ted (Chromium) Meyer added 1 comment

      File media/formats/hls/media_playlist.cc
      Dale Curtis . resolved

      Can we rename this to playlist_uri?

      Ted (Chromium) Meyer

      Done

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement 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: Id54803fc48b8417ab31e1041f15f0e3acb6225b6
        Gerrit-Change-Number: 7718533
        Gerrit-PatchSet: 4
        Gerrit-Owner: Ted (Chromium) Meyer <tmath...@chromium.org>
        Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
        Gerrit-Reviewer: Ted (Chromium) Meyer <tmath...@chromium.org>
        Gerrit-Comment-Date: Wed, 01 Apr 2026 21:09:46 +0000
        satisfied_requirement
        open
        diffy

        Dale Curtis (Gerrit)

        unread,
        Apr 1, 2026, 6:22:46 PM (yesterday) Apr 1
        to Ted (Chromium) Meyer, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org
        Attention needed from Ted (Chromium) Meyer

        Dale Curtis voted and added 1 comment

        Votes added by Dale Curtis

        Code-Review+1

        1 comment

        File media/formats/hls/media_playlist.cc
        Line 245, Patchset 6 (Latest): if (!resource_uri.is_valid()) {
        Dale Curtis . unresolved

        What is considered invalid? It seems like "https://example.com/manifest.m3u8".Resolve("https://anotherexample.com/file.key") would generate an invalid URI. Ditto with data://. Are the lines below even reachable post-Resolve? I assume so since you have a test which passes, but I don't really understand Resolve() then.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Ted (Chromium) Meyer
        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: Id54803fc48b8417ab31e1041f15f0e3acb6225b6
          Gerrit-Change-Number: 7718533
          Gerrit-PatchSet: 6
          Gerrit-Owner: Ted (Chromium) Meyer <tmath...@chromium.org>
          Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
          Gerrit-Reviewer: Ted (Chromium) Meyer <tmath...@chromium.org>
          Gerrit-Attention: Ted (Chromium) Meyer <tmath...@chromium.org>
          Gerrit-Comment-Date: Wed, 01 Apr 2026 22:22:34 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Ted (Chromium) Meyer (Gerrit)

          unread,
          Apr 1, 2026, 7:34:16 PM (24 hours ago) Apr 1
          to Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org

          Ted (Chromium) Meyer voted and added 1 comment

          Votes added by Ted (Chromium) Meyer

          Commit-Queue+2

          1 comment

          File media/formats/hls/media_playlist.cc
          Line 245, Patchset 6 (Latest): if (!resource_uri.is_valid()) {
          Dale Curtis . resolved

          What is considered invalid? It seems like "https://example.com/manifest.m3u8".Resolve("https://anotherexample.com/file.key") would generate an invalid URI. Ditto with data://. Are the lines below even reachable post-Resolve? I assume so since you have a test which passes, but I don't really understand Resolve() then.

          Ted (Chromium) Meyer
          `uri.Resolve(str path)` basically treats `path` as a GURL with potentially missing parts, and then fills those parts in from `uri`. In your example, the "str path" url isn't missing any parts, so it gets returned as a fully formed GURL. Some other examples:
          - `"https://example.com/xyz/manifest.txt".resolve("secret.key") => "https://example.com/xyz/secret.key"` (added scheme, origin, and dirname(path))
          - `"wss://example.com".resolve("//google.com/socket") => "wss://google.com/socket"` (added scheme)
          - `"http://example.com/long/directory/path.txt".resolve("/secret.key") => "http://example.com/secret.key"` (added scheme and origin)
          Open in Gerrit

          Related details

          Attention set is empty
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement 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: Id54803fc48b8417ab31e1041f15f0e3acb6225b6
            Gerrit-Change-Number: 7718533
            Gerrit-PatchSet: 6
            Gerrit-Owner: Ted (Chromium) Meyer <tmath...@chromium.org>
            Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
            Gerrit-Reviewer: Ted (Chromium) Meyer <tmath...@chromium.org>
            Gerrit-Comment-Date: Wed, 01 Apr 2026 23:34:03 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
            satisfied_requirement
            open
            diffy

            Ted (Chromium) Meyer (Gerrit)

            unread,
            Apr 1, 2026, 7:36:29 PM (24 hours ago) Apr 1
            to Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org

            Ted (Chromium) Meyer added 1 comment

            File media/formats/hls/media_playlist.cc
            Line 245, Patchset 6 (Latest): if (!resource_uri.is_valid()) {
            Dale Curtis . resolved

            What is considered invalid? It seems like "https://example.com/manifest.m3u8".Resolve("https://anotherexample.com/file.key") would generate an invalid URI. Ditto with data://. Are the lines below even reachable post-Resolve? I assume so since you have a test which passes, but I don't really understand Resolve() then.

            Ted (Chromium) Meyer
            `uri.Resolve(str path)` basically treats `path` as a GURL with potentially missing parts, and then fills those parts in from `uri`. In your example, the "str path" url isn't missing any parts, so it gets returned as a fully formed GURL. Some other examples:
            - `"https://example.com/xyz/manifest.txt".resolve("secret.key") => "https://example.com/xyz/secret.key"` (added scheme, origin, and dirname(path))
            - `"wss://example.com".resolve("//google.com/socket") => "wss://google.com/socket"` (added scheme)
            - `"http://example.com/long/directory/path.txt".resolve("/secret.key") => "http://example.com/secret.key"` (added scheme and origin)
            Ted (Chromium) Meyer

            Oh, forgot the "invalid" part. Basically its for if either the GURL on which `::Resolve` is called is itself not valid, or if the first arg is empty, or some other non-URL friendly characters, that kind of thing. It's here so that we catch stuff like people setting the key url to `:\\://:\\://:\\://:` or something equally insane.

            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement 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: Id54803fc48b8417ab31e1041f15f0e3acb6225b6
            Gerrit-Change-Number: 7718533
            Gerrit-PatchSet: 6
            Gerrit-Owner: Ted (Chromium) Meyer <tmath...@chromium.org>
            Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
            Gerrit-Reviewer: Ted (Chromium) Meyer <tmath...@chromium.org>
            Gerrit-Comment-Date: Wed, 01 Apr 2026 23:36:17 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Ted (Chromium) Meyer <tmath...@chromium.org>
            Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
            satisfied_requirement
            open
            diffy

            Ted (Chromium) Meyer (Gerrit)

            unread,
            1:48 PM (6 hours ago) 1:48 PM
            to Dale Curtis, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org

            Ted (Chromium) Meyer voted Commit-Queue+2

            Commit-Queue+2
            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement 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: Id54803fc48b8417ab31e1041f15f0e3acb6225b6
            Gerrit-Change-Number: 7718533
            Gerrit-PatchSet: 6
            Gerrit-Owner: Ted (Chromium) Meyer <tmath...@chromium.org>
            Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
            Gerrit-Reviewer: Ted (Chromium) Meyer <tmath...@chromium.org>
            Gerrit-Comment-Date: Thu, 02 Apr 2026 17:48:07 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Chromium LUCI CQ (Gerrit)

            unread,
            2:23 PM (5 hours ago) 2:23 PM
            to Ted (Chromium) Meyer, Dale Curtis, chromium...@chromium.org, feature-me...@chromium.org

            Chromium LUCI CQ submitted the change

            Change information

            Commit message:
            Restrict origins for HLS keys

            HLS encrypted content should not be able to use a key which was loaded
            from a source that is "insecure". A key-source is considered secure when
            it meets one of these requirements:
            - it is not a cross-origin key (hosted on the same domain as the frame
            in which it is being accessed)
            - it is a data:// url (fully embedded in the manifest)
            - it is on the same domain as the manifest from which it is loaded.
            - it has the proper Access-Control-Allow-Origin header for the top
            frame in which the media is being played.
            Bug: 497722578
            Change-Id: Id54803fc48b8417ab31e1041f15f0e3acb6225b6
            Commit-Queue: Ted (Chromium) Meyer <tmath...@chromium.org>
            Reviewed-by: Dale Curtis <dalec...@chromium.org>
            Cr-Commit-Position: refs/heads/main@{#1609376}
            Files:
            • M media/filters/hls_network_access_impl.cc
            • M media/filters/hls_network_access_impl_unittest.cc
            • M media/filters/hls_rendition_impl.cc
            • M media/filters/hls_rendition_impl.h
            • M media/formats/hls/media_playlist.cc
            • M media/formats/hls/media_playlist.h
            • M media/formats/hls/media_playlist_test_builder.h
            • M media/formats/hls/media_playlist_unittest.cc
            • M media/formats/hls/media_segment.cc
            • M media/formats/hls/media_segment.h
            • M media/formats/hls/media_segment_unittest.cc
            Change size: M
            Delta: 11 files changed, 201 insertions(+), 46 deletions(-)
            Branch: refs/heads/main
            Submit Requirements:
            • requirement satisfiedCode-Review: +1 by Dale Curtis
            Open in Gerrit
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: merged
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Id54803fc48b8417ab31e1041f15f0e3acb6225b6
            Gerrit-Change-Number: 7718533
            Gerrit-PatchSet: 7
            Gerrit-Owner: Ted (Chromium) Meyer <tmath...@chromium.org>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
            Gerrit-Reviewer: Ted (Chromium) Meyer <tmath...@chromium.org>
            open
            diffy
            satisfied_requirement
            Reply all
            Reply to author
            Forward
            0 new messages