Repository navigation
fix(hls)!: hold import resources and redirects to the playlist origin - #6374
Conversation
Quest-Claim: ce4e6142fd78fee7
Co-Authored-By: GPT-6 <noreply@openai.com>
|
Completed the resource-admission fix, regression coverage, migration guidance, and quest removal. HLS checks pass 202 tests; CLI checks pass 193 tests with readiness logging configured; full cross-language interop passes. The required full local CI attempt is limited by the unchanged Nix runner-image user-namespace permission failure documented above. No open implementation decisions remain. Recommend a release-compatible backport after main validation. (Written by GPT-6) |
|
No actionable comments were generated in the recent review.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The maintainer chose same-origin on 2026-10-22: a playlist reference and every redirect hop must match the playlist's scheme and authority. This PR settles the filesystem boundary only, so the quest stays with the origin rule and the Config::client decision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e0c713291
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
# Conflicts: # quest/m1/release-audit/hls-admission.md # rs/moq-hls/MIGRATE.md
Refuse any reference or redirect hop whose scheme, host, or port differs from the entry playlist, and drop import::Config::client so the importer owns the redirect policy. Finishes the hls-admission quest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodeQL's non-https-url query traced the literal HTTP reference in the cross-origin test into the request builder, though the test asserts it is refused. Building it by swapping the entry's scheme states the intent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merging. HLS import now refuses cross-origin playlists, segments and redirect hops, and drops Config::client, as the maintainer chose. CI is green, the current head has a non-Grok review, and (Written by Claude Opus 5.5) |
|
x |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Enabling auto-merge on d1057f1. CI is green (10/10), the branch is clean against main, (Written by Claude Sonnet 5.5) |
# Conflicts: # doc/bin/hls.md # quest/m2/hls-variant-area.md # rs/moq-hls/src/import.rs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # quest/m1/release-audit/README.md # quest/m1/release-audit/hls-admission.md # rs/moq-hls/MIGRATE.md
fix(hls): hold import resources and redirects to the playlist origin (backport #6374)
Problem
HLS import treats the playlist as untrusted input, but a playlist could still steer the importer to other origins: an absolute or network-path reference to another host, a
file:path from an HTTP(S) playlist, or a redirect hop to another origin. A caller-suppliedreqwest::Clientkept its own redirect policy, which the importer cannot override per request.Approach
The shared
Fetcherowns admission for every resource kind (playlists, init segments, media segments). It keeps the entry playlist URL and refuses any resource whose scheme, host, or port differs, before any I/O. The importer builds its own HTTP client with a redirect policy that checks every hop against the same rule before following it; a stopped hop reachesfetchas a 3xx and is refused there.Error::ResourceRefusedends the import immediately instead of riding the retry budget.Impact
import::Config::clientis removed.Error::ResourceRefusedis added to the non-exhaustive error enum.import::Importfetches only resources with the entry playlist's scheme, host, and port, and refuses a reference or redirect hop to any other origin with the newError::ResourceRefused, which ends the import. Serve every playlist, init segment, and media segment from the playlist's origin, rather than referencing a separate CDN host. Afile://playlist reads only local files, and other URL schemes are refused when constructing the import.import::Config::clientis removed: the importer builds its own HTTP client so it can hold redirects to the playlist's origin. Drop the field; there is no replacement for a custom client.file://playlist reads only local files. Unsupported entry schemes failImport::new.doc/bin/hls.mdstates the origin rule.Decisions
Config::clientrather than narrow it: it has no in-repo consumer, and a caller's client owns a redirect policy the importer cannot override. Dropped: custom TLS roots, proxies, and default headers for authenticated origins; a consumer that needs one can propose a narrowed option.file:resources only for afile:entry playlist (local fixtures keep working); other schemes are refused.Validation
cargo test -p moq-hls: new tests cover every reference form (relative, root-relative, network-path, absolute, scheme change, port change,file:from HTTP and HTTP fromfile:), same-origin redirects being followed, and a later cross-origin hop being refused without ever connecting to the other origin. The redirect test fails (times out connecting to the other origin) with the default redirect policy.just checkpasses: lint, docs, quest, markdown, and Rust tests (405 + 227, including 208 moq-hls tests and the CLI HLS import tests).rust/non-https-url).just test interop --allnot run: interop exercises no HLS path, and this changes no wire, FFI, or CLI surface.Follow-ups
Consider a release backport after main validation; a port that keeps
Config::clientshould document that the caller's client owns redirect handling.Addresses the two Codex findings: cross-origin references and redirect hops.
(Written by Claude Opus 5.5)
🤖 Generated with Claude Code