Security¶
Horde has accounts (model) and is meant for a network you trust. This page describes what Horde enforces so that a web page you visit, or a hostile DNS name, cannot use your signed-in browser to reach into that network. Sign-in is checked after these protections.
LAN by default
None of this replaces access control, and Horde is meant for a network you trust. To expose it to the internet, follow the internet exposure checklist; otherwise see Remote access.
What Horde enforces¶
| Threat | Defence |
|---|---|
A website you visit sends requests to http://truenas:8686 (for example to wipe the library) |
Every state-changing request must carry an X-Horde-Request header. Browsers force a CORS preflight for custom headers, and Horde never grants one. Sec-Fetch-Site: cross-site and a mismatching Origin are refused too (HTTP 403). The web app adds the header itself. |
| DNS rebinding: an attacker's domain re-points at your LAN address | Host allowlist (below). Other names get HTTP 400. |
| A page reads your library cross-origin | No CORS headers anywhere except the media routes below. |
| Links or thumbnails that make the server fetch internal URLs (SSRF) | URL safety. |
| Stored XSS through links, custom CSS | Only http(s) links are stored and rendered; custom CSS cannot load remote resources (it is sanitised when saved, again at startup for anything stored before the sanitiser existed, including the app_settings.json.bak a corrupt settings file is restored from, and when the first administrator adopts the settings kept from before accounts); a Content-Security-Policy is sent. |
| Oversized or fake uploads | Upload limits. |
| A member's browser reads internal addresses, model names or error texts (which can quote a URL) | Responses are trimmed for anyone but an administrator: members get statuses and counts, and a generic message where their screen reports a failure. See what members see. |
| A downgrade from HTTPS to plain HTTP on a public name | Strict-Transport-Security: max-age=31536000 on every response to a request that really arrived over HTTPS (directly, or X-Forwarded-Proto: https with HORDE_TRUST_PROXY=1). Never sent over plain HTTP; no includeSubDomains, no preload. |
| Guessing passwords, or a stolen password | Per-address back-off, a per-name slowdown and a daily ceiling (sign-in throttle); optional two-step sign-in, which an administrator can require. Failed-sign-in and new-device notifications. |
| Factory reset triggered by accident | The request must contain the typed phrase RESET (or ERASE MEDIA when erasing media). The UI asks for it. |
If you script the API yourself, send X-Horde-Request: 1 on every POST, PUT, PATCH and DELETE.
Updates from the app¶
Horde has no access to Docker and the container does not mount the Docker socket (that would be root on the host). The Update now button (Updating) only lets an administrator write a small request file, DATA_PATH/update/request.env, in Horde's own data folder. A cron job you set up on the host reads it and runs update.sh. What follows from that:
- Only administrators can start an update (
POST /api/system/update); members cannot even see it. - The request carries no command. The host runs the same
update.shyou would run by hand, on your configured update channel, with its database backup and automatic rollback. The worst a compromised Horde can do is ask for an update. - Horde controls its data folder, so the job reads and writes everything in
DATA_PATH/update/as that folder's owner (viasetpriv), never as root: a link planted there cannot make root read or overwrite other files. It also works from inside that folder only if it really isDATA_PATH/update(not a link elsewhere), never follows links to files, creates new files exclusively and reads at most 64 KiB, so a compromised Horde cannot point it at other files of the same user outside the container either. Request contents are validated, never executed. - This relies on Horde running as an ordinary user (
PUID/PGID, the default). WithHORDE_ALLOW_ROOT=1the data folder belongs to root and the job's file access runs as root too; do not combine that with the update button. - The cron job runs as root on the host, so the files it runs (
scripts/update_watch.sh,update.sh) must stay owned and writable only by trusted users. - Remove the cron job and the button disappears within 5 minutes. See ADR 0011.
Desktop app¶
The desktop app runs the same server on a personal computer, so a few things differ (ADR 0042).
- Loopback by default. The server listens on
127.0.0.1:8686, so nothing else on the network can reach it. Share on my home network in the tray menu moves it to all addresses. It is off by default, and Horde refuses to turn it on until an administrator account exists, so nobody can reach the first-visit account creation from the network. Everyone still signs in. - The window has no Node access. It shows Horde's pages with context isolation and the sandbox on and no preload script. Navigation stays on Horde's own address; any other link opens in your default browser, and only
httpandhttpslinks do. Permission requests are refused except what the player needs. - The shell and the server talk privately. The server's standard input is a pipe held by the shell (closing it stops the server), and a status file in the data folder says what is running. There is no extra HTTP route for this.
- Updates come over HTTPS from the project's GitHub Releases and are checked against the SHA-512 in the release's update file. The apps are unsigned for now, so that is the whole chain: there is no publisher check. Each release file is also attested (
gh attestation verify <file> --repo jm-connell/horde) and listed inSHA256SUMS. The Mac app does not install updates itself. - Bundled programs (Python, ffmpeg, ffprobe, deno) are pinned by SHA-256 in
desktop/vendor.lock.jsonand fetched only against that hash. The Python packages are the hash-checkedbackend/requirements.lock. - Unsigned apps show a warning on first open. See Install the desktop app.
Allowed hosts¶
Horde answers requests whose Host header is one of:
localhostand loopback addresses- any IP address that is not publicly routable: private ranges, link-local, and the CGNAT range Tailscale uses (
100.64.0.0/10) - single-word names such as
truenas - names ending in
.local,.lan,.home.arpa,.internalor.ts.net
Anything else, for example horde.example.com behind a reverse proxy, must be listed in HORDE_ALLOWED_HOSTS (comma separated, *.example.com matches subdomains). The list adds to the defaults, so localhost health checks keep working. * switches the check off.
HORDE_ALLOWED_HOSTS=horde.example.com,*.corp.example
A rejected request gets HTTP 400 with a message naming HORDE_ALLOWED_HOSTS, and the first rejection of each name is logged as a WARNING (so a proxy that sends its public name is visible in docker compose logs even without HORDE_TRUST_PROXY). If you reach Horde by a public IP address, add that IP to the list too.
Upgrading behind a proxy or tunnel
Installs that were reached under a public name before this check existed will see 400 host_not_allowed after updating until the name is listed. With HORDE_TRUST_PROXY=1 and HORDE_ALLOWED_HOSTS empty, Horde logs a warning at startup as a reminder.
Reverse proxies should pass the original Host (Caddy and nginx proxy_set_header Host $host do) or set X-Forwarded-Host.
CORS and casting¶
Chromecast receivers fetch media from a different origin, so these routes (and only these) send Access-Control-Allow-Origin: *, for GET, HEAD and OPTIONS, with Range allowed and Content-Range, Accept-Ranges and Content-Length exposed:
/api/videos/{id}/stream(original and?rendition=compat)/api/videos/{id}/subtitles/{lang}/api/thumbnails/{id}
These routes still need the viewer to be signed in: a request is served only with the session cookie or a ?mt= signed media token. A browser never sends the cookie with a cross-origin read that Access-Control-Allow-Origin: * answers, so another website can read these files only if it holds a signed media URL. The app asks for one (GET /api/videos/{id}/media-token) only when it hands a video to a Chromecast or AirPlay receiver. The token is an HMAC tied to one video and the user who asked for it, valid for 12 hours on these three routes only, and void once that user's password changes (Signed media URLs). Anyone given such a URL can fetch that one video until it expires. That is the price of casting without a login on the receiver.
Private URLs¶
Horde downloads things for you: thumbnails from a URL, and yt-dlp link checks, previews, downloads and playlist imports. Each URL must be http or https and must resolve only to public addresses. Loopback, private, link-local (including cloud metadata addresses), CGNAT, multicast and reserved ranges are refused. Where Horde makes the request itself it follows redirects by hand, at most five, and checks every hop again; yt-dlp is the exception (see below). Remote thumbnails are capped at 15 MB, decoded as an image and stored as a fresh JPEG.
If you download from LAN sources (a NAS, a local media server), set HORDE_ALLOW_PRIVATE_URLS=1. The scheme rule stays in force.
Where the check applies:
- Validated, per hop: thumbnail fetches and every URL the preview proxy (and the live HLS proxy) fetches on an extractor's behalf: media, subtitles, manifests and the DASH index probe. Thumbnail fetches pin each connection to the address that was checked; the preview client resolves and checks names when it opens a connection and connects only to those addresses, so DNS cannot answer the check and the connection differently (HTTPS still verifies the certificate for the host name). Redirects are re-checked on every hop. A host that does not resolve is never connected to; the proxy answers 502, as for any upstream failure, so a DNS blip on a CDN host does not end a live stream. Media proxied for stream previews is always served with a video, audio or generic binary content type and a sandboxing
Content-Security-Policy, never as a web page. The preview client does not useHTTP_PROXY/HTTPS_PROXY: a proxy would resolve the names itself. Cookie and authorization headers (such as the cookies yt-dlp attaches to a format URL) are dropped as soon as a redirect leaves the first URL's origin (scheme, host and port). - Pre-flight only: URLs handed to yt-dlp (downloads, link checks, stream previews, playlist and channel reads) are checked before the call, and the download queue re-checks each job before it starts. The check covers the address the person typed. yt-dlp then resolves hostnames and follows redirects itself; those internal requests are not validated, so a public address that redirects to an internal one is still fetched, and so is a name that resolves differently the second time. This includes stream previews, which any signed-in member can use. It is a known limitation, which is why this setting stays off and accounts should go only to people you trust.
- Not filtered: the AI provider addresses in Settings → AI and the notification targets are LAN hosts by design (admin-only settings). Notification targets must still be
http(s)without credentials in the URL, and redirects are not followed.
Upload limits¶
| Upload | Limit | Checked |
|---|---|---|
| Fonts | 8 MB, 50 stored | TTF / OTF / WOFF / WOFF2 signature |
| Backgrounds | 100 MB, 50 stored | Images decoded; WebM signature |
| Video thumbnails, playlist covers | 15 MB | Decoded and re-encoded as JPEG |
| Import (video file) | HORDE_MAX_UPLOAD_GB (default 50) |
Playable by ffprobe; 1 GB of disk must stay free |
| Any other request body | 8 MB |
Too large gives HTTP 413. Settings (ui) are capped at 256 KB; custom CSS at 64 000 characters.
Other limits: bulk endpoints take at most 1000 items (5000 for playlist entries); link previews run at most three at a time with a 60 second timeout (HTTP 429 / 504); at most HORDE_YTDLP_REQUEST_THREADS (default 8) requests are inside yt-dlp work at once, and the rest wait up to 15 seconds for a slot (HTTP 429) without occupying a server thread; thumbnail-candidate grabs run two at a time.
Content-Security-Policy¶
Every response carries Content-Security-Policy, X-Content-Type-Options: nosniff, Referrer-Policy: same-origin and framing is limited to the same origin. The policy lists what the app actually loads:
- scripts: its own bundle and the Google Cast sender SDK (
www.gstatic.com; over plain HTTP too, because the SDK loads its parts with the page's scheme, so casting works from a LAN address without HTTPS) - styles: its own, Google Fonts (
fonts.googleapis.com, for the optional UI font) and inline styles (the web app's own and your custom CSS) - images: its own, plus remote thumbnails over HTTPS (YouTube's
i.ytimg.comand other sites yt-dlp reads) - connections: its own API and SponsorBlock (
sponsor.ajay.app)
The browser calls SponsorBlock only when your SponsorBlock setting (Settings → Playback) is on. Separately, the server calls it for Ask: for each video whose captions Ask indexes, one request with the video's public YouTube id and no Horde account or user data (SponsorBlock sees the server's IP address; videos under 30 days old are asked again daily), so answers leave sponsor reads out. HORDE_ASK_SPONSORBLOCK=0 turns that off (ADR 0034).
The wiki under /wiki has a separate, looser policy because the documentation theme uses inline scripts.
Safari and iOS¶
Some stored files must be rewritten (AAC audio, faststart) before WebKit can play them. This never happens as a side effect of a GET. The player asks with POST /api/videos/{id}/compat/safari, waits for the job and then plays.