Security

Security

Kagaz aims to be secure by default without ever locking a family out of its own documents. These are the design choices and the trade-offs that come with them.

Kagaz is version 0.x and has not had an independent security audit. The full model is in SECURITY.md.

What is protected

ThreatProtection
Someone copies the storage bucket or the diskEach file is encrypted with its own random 256-bit key (AES-256-GCM), and that key is encrypted with MASTER_KEY. Document numbers, notes and remembered PDF passwords are encrypted too.
Someone copies the databasePasswords are stretched in the browser (PBKDF2-SHA256, 600,000 iterations) and the server stores only a salted hash of the result, so every guess still costs the full stretch. Recovery codes, session, invite, reset and API keys are stored as SHA-256 hashes.
Password guessingSign-in, recovery and key checks are rate limited. Unknown emails get the same answer as wrong passwords. Failed sign-ins are logged.
Cross-site attacksHttpOnly, SameSite session cookies, a required custom header on every change, a strict Content-Security-Policy, and no framing by other sites.
Malicious uploadsFile types are detected from content. Only JPEG, PNG and PDF are accepted, and they are served with a fixed type.
A lost phoneSign out everywhere, or an admin disables the account. Sessions last 30 days and extend while used.
Leaked backupsBackups are encrypted in the browser with your passphrase. The server never sees it.
AI assistantsPer-person keys with read or read-and-add access, masked numbers, no PDF passwords, no deletes, and every call logged. See AI assistants.

What Kagaz deliberately does not do

Keys and recovery

Reporting a vulnerability

Please report security problems privately with a GitHub security advisory, not in a public issue.