Skip to content

Security model

Session cookies are httpOnly, signed, and scoped to the registrable domain when one is available. On an IP address or localhost they are host-only, and the instance says so at boot:

BASE_URL host 192.168.68.200 cannot carry a shared cookie domain; using host-only cookies.

That warning is the honest version of a silent failure — a cookie with domain=.68.200 is rejected by every browser without an error.

TRUSTED_ORIGINS is an exact-match list. CORS headers are reflected only for listed origins, with Access-Control-Allow-Credentials: true; unlisted origins get no CORS headers and a 403 preflight. Never a wildcard, because cookies and * are incompatible.

State-changing requests without an Origin header are refused (MISSING_OR_NULL_ORIGIN), which also applies to scripts.

JWTs are EdDSA (Ed25519), 15 minutes, with iss and aud set to BASE_URL. Verification elsewhere needs only the JWKS endpoint. See Verifying tokens.

Secret Protects Rotation
BETTER_AUTH_SECRET cookies, JWKS private keys refuses boot on mismatch; deliberate rotation kills all sessions
POSTGRES_PASSWORD database change the password and DATABASE_URL together
RESEND_API_KEY / SMTP_PASSWORD mail independent

A SHA-256 fingerprint of the secret is stored in ownauth.instance. That is what lets the process say “you are using a different secret” instead of “failed to decrypt private key”.

  • The console 404s for non-admin sessions.
  • Every admin API call re-checks the session and role server-side.
  • Every mutation is audited, including refusals.
  • The acting administrator cannot ban, delete or re-role themselves.
  • Impersonation is recorded on the session and flagged in the UI.
  • TLS. Terminate it at your proxy. The instance will happily tell you BASE_URL is not https, and you should listen.
  • Rate limiting across replicas. Limits are per process.
  • Backups. Your database, your responsibility; see Upgrade.
  • Email deliverability. With provider: console nothing is delivered; that is a development setting and the Configuration page says so.

Security issues: open a private advisory on the repository rather than a public issue.