Skip to main content

Security model

Review how the container splits privileges, keeps each Transmission inside its selected tunnel, and protects the secrets and sessions it stores.

Why It's Built This Way

  1. Runs only the supervisor, the startup steps, and the VPN controller as root, so a flaw in the web interface or Transmission doesn't hand over network control.
  2. Gives each Transmission a fixed private address and a route through only its own tunnel, with the firewall as a second boundary.
  3. Encrypts VPN credentials, WireGuard keys, profiles, and notification secrets with a key unique to the installation, so a copied database alone doesn't reveal them.
  4. Keeps the native RPC on the container's loopback address, so every outside request passes the control plane's authentication first.

Privilege Separation

ComponentRuns asRole
s6-overlayroot, as the first processSupervises the services and orders startup and shutdown.
Startup checks and firewall setuprootValidate the identity, folders, and TUN device, and build the firewall boundary.
VPN controllerrootRuns OpenVPN or WireGuard, switches the firewall, and writes the DNS settings.
Control planePUID and PGIDServes the web interface and the API on port 22602, and compatible RPC on port 9091.
Web proxyPUID and PGIDAccepts authenticated HTTP and SOCKS5 connections on port 22605 and sends allowed destinations through the connection selected by each login.
Directory controllerPUID and PGIDLists and creates folders under /data, and deletes exactly one empty, unassigned folder at a time.
Transmission daemonsPUID and PGIDEach connection transfers its own torrents from a fixed private address that the firewall and routing rules match.

The control plane reaches the VPN controller through two local sockets, both owned by root:PGID with mode 0660:

  • /run/transmission-vpn/controller.sock — Accepts only typed status, connect, restore, disconnect, and set-default commands.
  • /run/transmission-vpn/direct.sock — Opens one TCP connection outside the VPN for provider catalogs and notifications, and hands it back. It refuses loopback and slot addresses.

Nova runs every unprivileged app service as the same numeric PUID:PGID, so no service uses a different fixed image account. The controller stays root because it needs network administration. Its socket protocols accept only the typed operations above; the firewall still prevents an unprivileged process from marking a packet or opening a route outside the VPN.

The control plane reads /data only to send a finished torrent's files to a signed-in browser. It sends only the files Transmission reports as complete, opens them read-only, and refuses symbolic links anywhere on the path, as the folder browser does.

Network isolation

  • Fixed source address — Each Transmission sends from 198.18.<slot>.1. Its route leads only to that connection's tunnel and fails inside the container while the tunnel is down.
  • Firewall — The firewall boundary drops every new connection the container opens outside a VPN tunnel, from any account. Only packets the VPN controller marks leave over the normal network: its tunnels, its lookups for VPN servers, and the connections it opens for the control plane. Marking a packet takes root, which only the supervisor, the startup steps, and the VPN controller have.
  • Fixed address boundary — Each fixed address passes only on its matching protected interface, and a backstop drops it everywhere else, loopback included, as covered in Leak protection.
  • Private RPC — Every Transmission has a separate native RPC listener on container loopback. These listeners are not published.
  • Three ports — The image exposes port 22602 for the web interface and API, port 9091 for compatible RPC, and port 22605 for the opt-in web proxy.
  • Web proxy limits — Only clients from 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7, and fe80::/10 may connect. The proxy permits only public IPv4 destinations and refuses private, loopback, reserved, multicast, and IPv6 destinations.
  • Web proxy fail-closed path — HTTP clients receive 503 and SOCKS5 clients receive a general failure when their selected connection is unavailable. The proxy binds every request to that connection's fixed address, which the firewall accepts only on the matching tunnel, so a request can't reach the container's own services either.
  • Blocklist fail-closed path — The Transmission runner downloads sources only when the default connection is protected. HTTPS and DNS sockets bind to that connection's fixed slot address, so the firewall and source-routing backstop prevent fallback through the container's ordinary interface.
  • Blocklist ownership — The runner owns every daemon's blocklists folder, writes one normalized file per usable source, removes other files and stale native indexes, and reloads running daemons. The control API never downloads a source itself.
  • Checked profiles — Profile normalization rejects OpenVPN profiles with scripts, plugins, proxies, or route overrides, and WireGuard files with PreUp, PostUp, PreDown, PostDown, Table, or FwMark lines. The VPN controller checks each profile again before it uses it.
  • No wg-quick — The controller sets up WireGuard with wg alone, so no line in a WireGuard file can run a program.

Compatible RPC boundary

The optional compatible RPC route presents the torrents from every connection as one Transmission. Torrent commands are sent only to the daemon that owns each torrent.

Remote apps can remove only torrents in that merged list. Unknown IDs and hashes are ignored instead of being sent to every daemon.

The facade refuses torrent-set-location with Change the torrent's profile in the console to move it. The profile workflow keeps the torrent's folder and VPN connection under one control-plane decision.

session-set accepts a fixed set of settings. Their names may use kebab case, snake case, camel case, or different capitalization:

  • Alternative speed limits and their schedule.
  • Blocklist enabled, cache size, encryption, DHT, LPD, PEX, and uTP.
  • Download and seed queue controls, stalled queue controls, and start-added behavior.
  • Download, incomplete, speed, peer, idle-seeding, and seed-ratio settings.
  • Partial-file renaming and original torrent-file cleanup.

Script settings, peer-port settings, random peer-port settings, and port-forwarding settings are refused. session-close and unknown methods are also refused.

blocklist-update is not forwarded to native daemons. It requests one runner merger update, waits for up to 60 seconds, and returns the total range count only after the merged attempt finishes.

Profile folders, incomplete folders, and folders supplied with torrent adds must stay inside /data.

Secrets

Accounts and sessions

  • One account — The installation has a single administrator account, created through the claim code. Its username matches without regard to letter case.
  • Browser sessions — A session lasts 24 hours and uses the tvpn_session cookie (HttpOnly) and the tvpn_csrf cookie, both with SameSite=Strict.
  • Change protection — Every change made from a browser must send an X-CSRF-Token header that matches the tvpn_csrf cookie.
  • Sign-in methods — A password, optionally followed by a 6-digit code from an authenticator app (TOTP) or a single-use recovery code. A passkey signs in on its own, without a code.
  • Passkeys — Need https (or localhost) and a domain name, and each passkey only works on the hostname it was added on.
  • Password changes — Changing the password signs out every other browser session.
  • Username changes — Sign-in and security changes the username after asking for the password. Browser sessions stay signed in and show the new name.
  • Password checks — Setting up or turning off the authenticator app, making new recovery codes, and adding or removing a passkey all ask for the password again first.
  • Backup confirmation — Export and import require Confirm it’s you with the password and current authenticator code, or with a passkey. Its grant lasts five minutes, works once, is bound to that browser session and to either export or import, and is kept only in memory.
  • Backup route boundary — Only a signed-in browser session can confirm, export, preview, or import a backup. API tokens cannot use those routes.
  • API tokens — Tokens start with tvpn_, carry the scopes torrents:read, torrents:write, vpn:read, vpn:write, settings:read and settings:write (a write scope includes its read scope), and expire on a date you choose or never.
  • Token management — Only a signed-in browser session can create, list, edit, or revoke tokens. A token's value is shown once and never changes when the token is edited, and revoking deletes the token.
  • Credential boundaries — API tokens are bearer credentials only for the API on port 22602. RPC logins use HTTP Basic authentication only on port 9091. Web proxy logins use HTTP Basic or SOCKS5 username and password authentication only on port 22605. None of the three works in place of another.
  • RPC login management — Add login generates a password that is shown once. Edit changes the username, and saving it with Generate a new password ticked replaces the password, shows the new one once, and stops the old one from working right away. Delete revokes the login, and the list records when it was last used.
  • Notifications — Only a signed-in browser session can list, add, edit, test, or remove notification destinations. An API token gets 403 with session_required, whatever its scopes.
  • Precedence — When a request carries both a bearer token and session cookies, the token decides what the request may do.
  • API token failures — An invalid bearer token receives 401. It does not use the administrator, RPC, or web proxy failed-sign-in counters.
  • Rate limit — After 10 failed attempts from one address, or one /56 network for IPv6, more attempts are refused until 15 minutes have passed since the first failure. Wrong passwords, authenticator codes, recovery codes, passkeys and password checks all count toward one sign-in limit, and a refused attempt's Retry-After header gives the seconds left. Claims are counted separately, and only a wrong or expired claim code counts as a failed claim.
  • RPC login limit — After 10 failed RPC sign-ins from one IPv4 address or IPv6 /56 network in 5 minutes, port 9091 returns 429 until that 5-minute window ends.
  • Web proxy login limit — After 10 failures from one client in 5 minutes, the proxy blocks that client for 5 minutes. HTTP clients receive 429; SOCKS5 clients receive an authentication failure.
  • Reverse proxies — X-Forwarded-For, X-Forwarded-Proto and X-Forwarded-Host are honored only from private or local addresses, so a proxy on the same Docker network or LAN passes the visitor's real IP and https. From a public address they're ignored.

Browser protections

  • Content Security Policy — default-src 'self' with frame-ancestors 'none', so the interface loads only its own files and can't be framed.
  • Other headers — X-Frame-Options: DENY, X-Content-Type-Options: nosniff, and Referrer-Policy: no-referrer.
  • Caching — Responses use Cache-Control: no-store, except the compiled files under /assets/.

Known limits