Repository navigation
fix(web): stop sending the login token to proxy node stream URLs - #3131
Merged
Merged
Conversation
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 Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
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. |
Contributor
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
buildPlayerStreamUrlnow returns absolutehttp(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/v3grant URLs that need anAuthorizationheader.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
make test-web: pass.mainand pass here.tokenquery: pass.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
AI Disclosure
🤖 Generated with Claude Code