Security Overview
Trackarr is built with security as a foundational principle, not an afterthought. This page describes each layer. For what was attacked, what broke and what changed, see Audits and Tests.
Security Layers
| Layer | Protection |
|---|---|
| Authentication | Zero-knowledge login, optional two-factor (TOTP) that admins can require for staff, PoW anti-abuse, sealed sessions revocable at once, known device tokens against lockout attacks |
| Requests | Requests from other origins refused, body size and type checked before reading, rate limits per address and per account |
| Content | Descriptions reduced to formatting, links and images to other sites blocked by default, uploads served sandboxed |
| Database | SCRAM-SHA-256 auth, prepared statements, connection pool limits, application role without superuser rights |
| Staff | Every staff action in an audit log, alerts on the sensitive ones |
| Redis | Password auth, command restrictions, memory limits |
| Network | Only the reverse proxy is published, proxy headers trusted from it alone, trap paths for scanners |
| Privacy | Hashed IPs in peer lists and alerts, no client address in access logs, panic mode |
Requests From Other Sites
The session cookie is SameSite=Lax, which stops other sites but not other origins of the same site: a page on a sibling subdomain could post a form with a visitor's cookie. Browsers state where a request comes from (the Sec-Fetch-* headers), so the server refuses anything a page of another origin made the browser send, apart from a visitor following a link. Browsers without these headers are checked on Origin for writes.
Clients that are not browsers (the upload CLI, feed readers, Prowlarr, Sonarr) send none of these headers and are not affected.
Request Bodies
Handlers buffer a body before validating it, so its size has to be bounded first:
- JSON bodies up to 1 MB, file uploads up to 11 MB, each route applying its own smaller limit
- a body without
Content-Lengthis refused (411) - only JSON and multipart are accepted (
415otherwise): an HTML form from another origin can send neither with the right type - Caddy applies a 16 MB cap in front, and 64 KB on the tracker host
Rate Limits
Trackarr implements distributed rate limiting to prevent abuse:
| Endpoint | Limit | Action on Abuse |
|---|---|---|
| Public API | 100/min | 100+ req/10s → address blocked |
| Mutations | 10/min | 429, then a block after repeated violations |
| Login | 10/5min per address | 429, no block |
| Registration | 5/5min | 429, then a block after repeated violations |
| Tracker | 200/min | Distributed sliding window |
Exceeding a limit answers 429. An address is blocked only when it exceeds limits in three separate windows within an hour, for 5 minutes at first, doubling each time within 24 hours up to a day. This keeps one fast member, or people sharing an address (VPN exit, carrier NAT), from losing the whole site over a burst.
Login Protection
Failed logins are counted twice:
- per account and source address: after 10 failures in 15 minutes that address is refused for that account, and nobody else is
- per account, all addresses: after 20 failures in 15 minutes password logins are paused, except from browsers that already signed in to the account
The exception relies on a known device token: a cookie set at each successful login, derived from the username and the session secret. It proves nothing by itself and only lifts the pause, so an attacker sending wrong passwords for an admin's name cannot keep that admin out. Every username is counted, existing or not, so a refusal never tells whether an account exists.
Two-Factor Authentication
Any member can add a code from an authenticator app (TOTP) to their sign-in, and admins can require it for moderators and admins. There is no e-mail in Trackarr, so recovery relies on single-use recovery codes, on an admin, or on a command run on the server. Enrolling asks for the password again, a code cannot be replayed, and turning it on signs every other session out. See Two-Factor Authentication.
Sessions
Sessions are sealed (encrypted) cookies valid 7 days. Each one carries the account's session_version from sign-in, checked against the database on every authenticated request: when the version changes, every older cookie is rejected at once (401) on every node. A banned account is refused with 403 for as long as the ban lasts.
The version is bumped when:
- a moderator or admin bans the account (sessions stay revoked after an unban)
- the user clicks Sign out other devices in the account menu (the current session is kept)
Panic mode does not sign anyone out: the admin needs their session to reach the restore form, since nobody can log in while verifiers are encrypted.
Member Content
Torrent descriptions accept Markdown and BBCode, rendered in the browser and reduced to formatting:
- an explicit list of tags and attributes: no
<style>, no form or input, noclassorid - three style properties (
text-align,font-size,color), which is what BBCode needs - no image from the site's own pages or API: every viewer's browser would request it with their session
- links and images to other sites are blocked by default. A blocked link is shown as text with its address, a blocked image is replaced by the name of its host
Admins change this in Admin → Security → Torrent descriptions: allow links, allow images, or keep both blocked and add trusted hosts (subdomains included) for both. Pixhost is trusted out of the box because the upload assistant stores screenshots there. The setting applies when a description is displayed, so changing it affects existing torrents too.
An image from a trusted host is still loaded by every viewer, whose address that host sees. Keep the list short.
Forum posts, comments, private messages and shoutbox messages are rendered as plain text.
IP Privacy
- Peer lists, statistics and security alerts carry a SHA-256 hash of the address, salted with
IP_HASH_SECRETand the date - Caddy access logs keep no client address, and query strings lose
passkeyandapikey - The last sign-in address is stored per account: IP bans and the multi-account guard need it. Admins see it, moderators do not, and panic mode encrypts it
- Peer addresses live in the tracker's memory while a peer is active, since other peers need them to connect
Attack Detection
Admins are alerted (admin panel, and Discord or Slack when a webhook is set) on:
- brute force on one account, and on the tracker (invalid passkeys)
- scanners probing trap paths (
/.env,/wp-admin,*.php…) and bots filling hidden form fields: see Honeypots - addresses blocked for flooding
- upload claims no connection could carry, or larger than a swarm could take
A trap path requested by a visitor's browser because a page embedded it (an image, a redirect) is answered 404 without a block: otherwise anyone able to show a member an image could lock them out.
Security Updates
When a release fixes a vulnerability, its notes carry a Security heading. An instance that has not installed it yet shows it to its admins, and only to them:
- a red banner at the top of every page, linking to the update instructions
- in Admin → Security → Version & Updates, the update in red with an Important badge and the list of security releases still missing, even when a later ordinary release is the newest one
The server reads the public release list on GitHub at most once every 6 hours, and only when an admin is browsing. Set UPDATE_CHECK=false to never contact GitHub: the panel then shows no update notice at all, so follow the releases another way.
Release notes and manual steps
Admin → Security → Version & Updates also lists every release the instance has not installed, oldest first, with its notes. When one of them needs a step of your own (a renamed variable, a one-off command, everyone logged out once…), its notes carry an Upgrade notes heading (or Breaking changes, Migration, Action required):
- the release gets an orange Action required badge, and its upgrade section is shown first, under Before updating
- admins see an orange banner at the top of every page until it is installed (the red security banner wins when both apply)
Read those sections in order, then run the update commands shown under the list:
cd /opt/trackarr
git pull origin main
sudo ./scripts/install.shThe installer keeps the secrets, the data and the monitoring pairing.
For maintainers: the notes are the body of the release/vX.Y.Z pull request. Put security fixes under ## Security and anything an admin must do under ## Upgrade notes; nothing else is needed.
Staff Audit Log
Every action a moderator or an admin takes is recorded: who, when, what, on whom, with a one-line summary. Passkeys, API keys, wallet keys and URLs are redacted before anything is stored. Admins read the log in Admin → Security → Audit log, newest first, filtered by action or by staff member.
Three kinds of event also raise a security alert: an account made admin, a change to where payments are received, and anything about panic mode, failed panic passwords included. A stolen admin session that redirects sign-up payments or promotes an accomplice does not go unnoticed.
Members acting on their own content are not logged. In panic mode the summaries are encrypted with the rest.
Database Role
The application and the tracker connect to PostgreSQL with a role that owns the application tables and nothing else: no superuser rights, no role or database creation, no access to server files or programs. The superuser is kept for administration and backups, with its own password that the application never sees.
New installs get this from the start. An install made before this release keeps working unchanged, and is migrated once with:
sudo ./scripts/backup.sh
sudo ./scripts/db-split-role.shHost Hardening
The server around Trackarr matters as much as the application: a tracker with SSH open to password guessing is one weak password away from a full compromise. The installer offers to run this check, and it can be run at any time:
sudo ./scripts/harden-host.sh --check # report only, exit status 1 when something is weak
sudo ./scripts/harden-host.sh # explain each point and ask before fixing itIt covers SSH (keys only, no password for root), fail2ban, automatic security updates and the firewall. It never disables password login unless a public key is already in place for the account you sign in with.
Learn More
- Audits and Tests: What was attacked and what changed
- Zero-Knowledge Authentication: How passwords are never transmitted
- Two-Factor Authentication: Authenticator codes, recovery, staff requirement
- Panic Mode: Emergency data encryption
- Honeypots: Traps for scanners and bots
- Community Safeguards: Hateful words filter and multi-account guard
- Backup & Restore: Encrypted backups and restore tests