Skip to content

[bug] Jellyfin stream and subtitle URLs carry the device's login token #2906

Closed

Description

@Quick104

What happened

Silo's Jellyfin-compatible API puts the device's login token into media URLs it builds:

  • DirectStreamUrl in PlaybackInfo carries the token in an api_key query parameter.
  • Every subtitle DeliveryUrl in PlaybackInfo carries it the same way.
  • The trickplay playlist GET /Videos/{itemId}/Trickplay/{width}/tiles.m3u8 repeats the caller's token as ApiKey on every sheet line.

That token is the device's full login credential. It stays valid as long as the Jellyfin login does (the compat session TTL defaults to 87,600 hours), and the Jellyfin API accepts it as an ApiKey/api_key query parameter on every route, including Quick Connect authorization and account settings. A stream or subtitle URL recorded by a reverse proxy, CDN, or player log therefore grants access to the whole account until the device signs out. Silo redacts these parameters from its own logs, but infrastructure in front of Silo does not.

The token isn't needed in these URLs. The stream and subtitle routes already accept the PlaySessionId that the same URLs carry. That grant covers GET/HEAD on the negotiated item and source only, ends with the play session, and stops working when the device signs out. HLS TranscodingUrl and attachment URLs already rely on it alone.

Steps to reproduce

On a Silo dev deployment built from main at d00462089:

  1. Sign in to the Jellyfin API with a regular user account.
  2. Enable seek-bar previews on a TV library and let one episode with a text subtitle track (ASS) finish generating them.
  3. POST /Items/{episodeId}/PlaybackInfo with a device profile that allows direct play and external subtitles.
  4. Read MediaSources[0].DirectStreamUrl and the subtitle stream's DeliveryUrl.
  5. GET /Videos/{episodeId}/Trickplay/300/tiles.m3u8?MediaSourceId=... with the token in a header.

Expected behavior

Server-built media URLs carry only a credential scoped to that media, such as PlaySessionId, and never the device's login token. A logged URL should at most grant that one item and source until the play session ends.

Silo version / commit

main at d00462089

Deployment

Local dev build

Area

Jellyfin-compatible clients

Clients affected

  • Jellyfin-compat client (Infuse, Findroid, ...)

Client app and device

Any client that receives these URLs. Reproduced at the API with a scripted client. Jellyfin Web also builds its own direct-play and trickplay sheet URLs with ApiKey; a server change can't remove those.

Media and playback details

H.264 MKV episode with an embedded ASS subtitle track (delivered as External); seek-bar previews at width 300.

Relevant logs

Responses from the reproduction. The query parameter holding the token is replaced by a marked redaction:

DirectStreamUrl: /Videos/02c30305-8fba-0401-1100-000000000000/stream?static=true&mediaSourceId=03000000-0000-0000-0000-000000000086&[REDACTED api_key parameter: compat token]&PlaySessionId=b3918c95-4b20-5e99-a4e6-57372d86eb6f
Subtitle 2 (ass, External) DeliveryUrl: /Videos/02c30305-8fba-0401-1100-000000000000/03000000-0000-0000-0000-000000000086/Subtitles/2/stream.ass?PlaySessionId=b3918c95-4b20-5e99-a4e6-57372d86eb6f&[REDACTED api_key parameter: compat token]
tiles.m3u8 (width 300): 2 sheet lines; first: 0.jpg?[REDACTED ApiKey parameter: compat token]&MediaSourceId=03000000-0000-0000-0000-000000000086

The same stream and subtitle URLs with the token removed, fetched with no auth header, still answer 206 and 200 through PlaySessionId. The trickplay sheet answers 401 without a token.

Technical notes

  • DirectStreamUrl: mediaSourceDTO in internal/jellycompat/handlers_playback.go.
  • Subtitle DeliveryUrl: subtitleDeliveryURL in the same file, reached from mediaSourceDTO, downloaded subtitles, and buildMediaStreamsWithSelection.
  • Trickplay: HandleTrickplayPlaylist in internal/jellycompat/handlers_trickplay.go. The sheet route sits in the token-only route group, so it cannot accept PlaySessionId today.
  • PlaybackSessionAuth and playbackGrantMatchesRequest in internal/jellycompat/auth.go already authorize media routes by PlaySessionId.
  • PlaySessionId-only URLs expire with the play session, so a subtitle fetched after the session ends or after Sessions/Playing/Stopped would be refused unless the client sends its own token.
  • Refusing query-string tokens on non-media routes would reduce the exposure further. Real clients send ApiKey on many routes, so that needs a client survey first and is not part of this issue.

AI harness

Claude Code (T3 Code)

AI tool(s)

Claude Code CLI; T3 Code orchestration; GitHub CLI

AI model(s)

claude-opus-5-5

AI involvement

Fully AI-generated, human verified

Independent or adversarial review

The fix plan is being reviewed by gpt-6.1-sol (Codex) before implementation.

Confirmations

  • I searched open and recently closed issues and pull requests, and this is not already reported
  • I reproduced this myself on a real deployment
  • Any logs provided are raw apart from marked redactions and are not AI-summarized; if none were available, I said so above

Source: internal code audit

Activity

  1. added
    bug
    on Oct 22, 2026
  2. self-assigned this
    on Oct 22, 2026
  3. Quick104 commented on Oct 22, 2026

    @Quick104
    ContributorAuthor

    🤖 AI agent claim. Claude Code in T3 Code (claude-opus-5-5) is working on a fix for this issue on behalf of @Quick104, who is assigned.

    A pull request will link here when the fix is ready. If the work stops without a fix, the assignment and this comment are removed.

    Planning to work on this, or have context to add? Reply here and mention @Quick104.

  4. added
    impact: security
    priority: P0
    on Oct 22, 2026
  5. added a commit that references this issue on Nov 5, 2026
    dfbf247
  6. added a commit that references this issue on Nov 5, 2026
    77a1fe4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugimpact: securitypriority: P0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions