Security
What the product does
Section titled “What the product does”- Argon2id password hashing; JWT with issuer (
leviro-relay) and HS256-only validation; session revocation via a version counter. - CSRF protection on browser endpoints (the
/api/v1/*surface usesX-API-Keyinstead, by design). - Socket.IO authentication — the handshake is authenticated and the origin is enforced, because the
wa:qrevent can pair a device. - API keys are stored as SHA-256 hashes, with expiry, total budgets, per-minute limits, and IP allowlists.
- AES-256-GCM credential encryption for the WhatsApp session, Telegram bot token, backup credentials, and webhook secrets. Rotating or losing the WhatsApp encryption key forces re-pairing; back it up separately from the database.
- Webhook SSRF protection: scheme checks, DNS resolution with private/loopback/link-local rejection, redirects never followed, 10-second timeout.
- Upload validation against the file’s actual leading bytes, not the type the client declared.
- Signal key material redaction in logs and responses; error text is redacted in production.
What the operator must do
Section titled “What the operator must do”- Generate fresh, independent secrets; never commit
.envor API keys. - Put production deployments behind HTTPS; never publish MongoDB or Redis ports.
- Keep MongoDB, Redis, Node.js, and the host system updated.
- Store backup archives encrypted at rest and access-controlled (see Backups & recovery). Archives are unencrypted
.tar.gzbearer bundles — anyone holding an archive and the encryption secret holds the accounts. - Back up
WA_SESSION_ENCRYPTION_KEYseparately from the database. - Only message recipients who have consented; follow the law and the platforms’ terms.
Host pinning
Section titled “Host pinning”Compose publishes the application port on 127.0.0.1 only by default (APP_BIND_ADDRESS, falling back to HOST); MongoDB and Redis publish no ports at all. CORS and the Socket.IO origin allowlist are APP_BASE_URL plus one optional EXTRA_ALLOWED_ORIGIN, both bare origins.
Historical note
Section titled “Historical note”Four WhatsApp invite codes existed in a historical channels.json in the repository (no tokens). The recommendation is to reset/regenerate those links rather than rewrite git history; the owner decision is still pending.
Reporting a vulnerability
Section titled “Reporting a vulnerability”See Security policy. Do not post sensitive vulnerability details publicly before responsible disclosure.