LibreAuth

Security

Threat model

LibreAuth protects against unauthorized access to your TOTP secrets and session. It does not protect against a compromised device, shoulder surfing, or phishing — use backup codes and hardware keys for high-value accounts.

Data flow

1

Browser

Web Crypto generates TOTP from secret in memory

2

Supabase

Encrypted TLS stores secrets with RLS per user

3

Session

HTTP-only cookies validate auth server-side

Architecture

Codes compute in your browser via Web Crypto (RFC 6238). Secrets live in Supabase behind row-level security — only your user ID touches your rows. No server-side TOTP generation.

Authentication

Supabase Auth + @supabase/ssr cookies. Protected routes validate sessions server-side before render. Logout clears cookies via server endpoint.

Database policies

Every totp_entries row is scoped to auth.uid():

  • SELECT — own rows only
  • INSERT — must match authenticated user
  • UPDATE / DELETE — own rows only

Recommendations

  • Strong unique password for your LibreAuth account.
  • Enable email confirmation in Supabase for production.
  • Self-host for full data control and custom auth policies.
  • Keep service backup codes — authenticators are not account recovery.
  • Use a password manager alongside 2FA for defense in depth.

Roadmap

Client-side vault encryption with a separate passphrase — secrets opaque even to the database operator. Export/import bundle. Hardware key login for the vault itself.

Security FAQ

Can LibreAuth staff read my secrets?
On the default hosted setup, secrets are stored in Supabase with RLS — not accessible to other users. Client-side vault encryption is planned so even DB operators cannot read them.
What happens if Supabase is down?
Already-loaded accounts still generate codes in your browser. You cannot sync new entries until service restores.
Is Web Crypto safe for TOTP?
Yes. HMAC-SHA1 via crypto.subtle is the standard approach for browser-based authenticators and is used by major web apps.
Get started

Read the code yourself.

AGPL licensed. Audit the repo, run the migration, deploy your own instance.