Skip to content

fix(web): stop sending the login token to proxy node stream URLs - #3131

Merged
Quick104 merged 1 commit into
mainfrom
fix/sec-web-node-stream-token
Oct 27, 2026
Merged

Quick104 merged 1 commit into
mainfrom
fix/sec-web-node-stream-token

Conversation

@Quick104

@Quick104 Quick104 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: changes #1177 C1; changes #1177 C3

When a playback plan sends the web player to a proxy node, the player added the viewer's login access token to the stream URL as ?token=. The proxy never reads that parameter, because its stream routes authorize from the signed stream token already in the URL path. It did pass the query on to the transcode node, which copied it into the segment URIs of every playlist. As a result, every proxy and transcode node received the login tokens of everyone who played through it, admins included, and so did anyone able to change the client origin a node advertises. The worker protocol says viewer credentials are not forwarded to nodes. An automated security scan found this.

With this change the web player sends its login token only to the API.

Approach

buildPlayerStreamUrl now returns absolute http(s):// URLs unchanged and adds the token only to paths it resolves against the API base. The server produces absolute stream, subtitle and font URLs only for proxy origins; API-local URLs are relative, so playback relayed through the API keeps its token. The web player does not negotiate header-authenticated media, so it never receives the /stream/v3 grant URLs that need an Authorization header.

The video and audiobook players share this helper, so both are covered. The server, nodes, API contract, and the Apple and Android clients are unchanged.

Validation

  • Web gate (frozen install, lint, format check, build, budget check): pass.
  • make test-web: pass.
  • Two new rows in the stream-url unit test cover absolute proxy URLs passed with a token. Both fail on main and pass here.
  • The existing proxy route test serves a signed direct-play URL with no token query: pass.
  • Not run: live web playback through a real proxy and transcode node. Distributed transcode nodes — Server #1177 C1 and C3 cover that path and should be re-run on a build with this change.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/pr-3131/

Nothing on screen changes. When the web player plays through a proxy, its requests no longer carry ?token=, so proxy and transcode node request URLs, and the segment URIs a node returns, stop containing the viewer's login token. Requests to the API are unchanged. Nothing is drawn differently. The evidence page has the helper's output for the same inputs on both commits.

Risks

Low. A proxy that authorized web requests from the query token would now answer 401, but no proxy route reads it: they all verify the signed token in the path.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: T3 Code (Claude Code)
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated; no human has reviewed the diff yet
  • Adversarial review: automated security scan finding, independently re-verified against the code by a separate agent

🤖 Generated with Claude Code

The web player appended the viewer's access token as ?token= to every
stream URL, including absolute URLs on proxy node origins. Those routes
authorize from the signed stream token in the path and never read the
login token; the proxy forwarded it on to the transcode node, which
echoed it into segment URIs. Any node operator, or anyone who could
influence a node's advertised client origin, could collect viewers'
login tokens.

Attach the token only to API-relative paths and pass absolute URLs
through unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Oct 27, 2026
@silo-kody

silo-kody Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T02:08:19.505423Z 0852d5e PR opened
🔒 Security Review ✅ Completed 2026-10-27T02:10:01.158096Z 0852d5e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2758b560-ca5a-4473-82da-689875dc0a42
Commits

Reviewing files that changed from the base of the PR and between 073a5c4 and 0852d5e.

Files selected for processing: 2
  • web/src/player/stream-url.test.ts
  • web/src/player/stream-url.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Walkthrough

The stream URL builder returns absolute HTTP(S) URLs unchanged, without appending the viewer’s login token. Relative paths continue through API path projection and base URL construction, then receive the token when provided.

Changes: Stream URL handling

Layer / File(s) Summary
Absolute URL resolution
web/src/player/stream-url.ts, web/src/player/stream-url.test.ts
The builder returns absolute HTTP(S) paths before API path projection and token appending. Tests cover absolute proxy and node media URLs. Relative paths continue through API URL construction and token appending.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • Silo-Server/silo-server#2906 — The issue reports login credentials in server-generated media and subtitle URLs. This change avoids appending the login token to absolute proxy stream URLs during web playback.

Suggested reviewers: rxwatcher

Merge Risk: Minimal · up to 0852d

No actionable merge-blocking risk was identified in the reviewed playback URL flows.

Architecture risk: Low · up to 0852d

The change affects 1 system.

Changed systems: web

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — web (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in web/src/player/stream-url.test.ts: Adds cases expecting absolute proxy and node media URLs to be returned unchanged, without the login token appended.
  • observed — Modified behavior in web/src/player/stream-url.ts: The comment now says that only API-relative paths receive the token and that absolute URLs use their signed stream token rather than the viewer’s login token.
  • observed — Modified behavior in web/src/player/stream-url.ts: buildPlayerStreamUrl now returns absolute HTTP(S) paths immediately, so they bypass API path projection and token appending. The comment narrows projection to API-local delivery routes and removes its earlier explicit statement that absolute URLs remain untouched.
  • observed — Modified behavior in web/src/player/stream-url.ts: Base construction now always concatenates apiRoot and streamPath; absolute URLs are handled by the earlier return instead of the removed conditional branch.
Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the primary change: the web player no longer sends the login token to proxy node stream URLs. It is specific, under 80 characters, and matches the diff in buildPlayerStreamUrl, which r…
Description check Passed The description explains the problem (login tokens forwarded as ?token= to proxy and transcode nodes), the approach (absolute URLs returned unchanged, token added only to API-base paths), the two new …
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the primary change: the web player no longer sends the login token to proxy node stream URLs. It is specific, under 80 characters, and matches the diff in buildPlayerStreamUrl, which returns absolute http(s) URLs unchanged and adds the token only to API-relative paths.

Full details: Description check

Explanation

The description explains the problem (login tokens forwarded as ?token= to proxy and transcode nodes), the approach (absolute URLs returned unchanged, token added only to API-base paths), the two new stream-url test rows, validation steps, and risks. It directly matches the changes in stream-url.ts and stream-url.test.ts.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@silo-triage silo-triage Bot added bug Something isn't working impact: security Auth, privacy, or permission boundary priority: P0 Fix/merge first: data-loss, security, or widespread breakage labels Oct 27, 2026
@Quick104
Quick104 merged commit 1ede9b3 into main Oct 27, 2026
26 checks passed
@Quick104
Quick104 deleted the fix/sec-web-node-stream-token branch October 27, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: security Auth, privacy, or permission boundary priority: P0 Fix/merge first: data-loss, security, or widespread breakage size/S 0–49 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant