Security
Fret holds your accounts at paid services and writes onto your disk: it is worth protecting. This page describes what Fret does on its own and what is up to you.
Recommendations
Section titled “Recommendations”- Do not expose Fret to the Internet without HTTPS. Put it behind a reverse proxy with a certificate, or reach it through a VPN.
- Choose a long password. The minimum is 8 characters; more is better.
- Keep
FRET_AUTH=nonefor setups where a proxy authenticates every request, and make sure Fret cannot be reached around it. - Keep collection confirmation on: any web page can send links to the collection port.
- Back up
secret.keywith the database, and protect both like passwords: see Backup and restore. - Run the latest release: only it receives security fixes.
Access
Section titled “Access”| Protection | Details |
|---|---|
| Password | A single password, hashed with argon2id (64 MiB, 3 passes). |
| Sessions | HttpOnly cookie, SameSite=Lax, Secure over HTTPS. Valid 30 days, extended while you use Fret. Stored as SHA-256 hashes. |
| API tokens | Start with fret_, shown once, stored as SHA-256 hashes, revocable at any time. |
| Sign-in attempts | 5 per minute per IP address, then refused with too_many_attempts. |
| Changing the password | Closes every session, on every device. |
Behind a reverse proxy, every sign-in comes from the proxy’s address: the attempt limit then applies
to all clients together. Fret ignores X-Forwarded-For, which a client could forge.
Browser protections
Section titled “Browser protections”- Cross-site requests: any request that changes something (
POST,PUT,PATCH,DELETE) coming from another website is refused. A malicious page cannot drive your Fret through your browser. - Headers: a
Content-Security-Policythat only allows content from Fret itself and forbids framing,X-Frame-Options: DENY,X-Content-Type-Options: nosniff,Referrer-Policy: same-origin.
Scripts and the command line are not affected: they send no browser headers.
Accounts
Section titled “Accounts”The credentials of your carriers and forwarders are encrypted in the database with AES-256-GCM,
using the key secret.key created in the data folder on the first start. The API never returns them:
only the last four characters of a key are shown.
Without secret.key, the saved credentials cannot be read; you then only have to enter them again.
Downloads and unpacking stay inside the warehouse:
- file names suggested by servers are cleaned (separators, control characters, reserved names);
- shipment folders refuse
..and absolute paths; - archives with a path that leaves their folder are refused, symbolic links in archives are skipped;
- an existing file is never overwritten.
Collection
Section titled “Collection”The collection port accepts links from any web page opened in your browser. By default, collected shipments wait for your confirmation on the dock, and outside Docker the port only listens on the machine itself. See Collection.
The Docker image
Section titled “The Docker image”The image is built on distroless/static: no shell, no package manager, only the fret program. It
runs as an unprivileged user (65532).
Reporting a vulnerability
Section titled “Reporting a vulnerability”Do not open a public issue. Use GitHub’s private reporting: Security › Report a vulnerability on the repository. The policy is in SECURITY.md.