Threat model
What a vault protects, and what it does not. A vault is device-encrypted, server-blind: its stores are sealed on the user's devices, and the app's server and relay keep only ciphertext. If every passkey and the recovery code are lost, the data is lost.
What it protects against
- A breach of the app's server or its database. The attacker gets blobs and wrapped roots. Opening them needs the user's passkey (its PRF output never leaves the device) or the recovery code. Neither is on the server.
- The app's operator, and anyone who administers its database. They can read, copy or delete records, but they cannot open them. Escrow is the exception, when the user turns it on: the operator holds one share, and opens nothing without this device's share.
- Backups and logs. They hold what the server holds: ciphertext. The server never logs a blob's content, and it has none to log.
- The relay (
qatjs dev,@qatjs/sync-server). It passes and keeps sealed operations; it cannot read one, and one it changes does not open. - A rolled-back or swapped blob. A blob is bound to its store and its version. The server cannot pass an older version, or another store's blob, for the current one.
- A secret leaking through the app's own code. Every vault field is a secret to the compiler.
A flow to the server, a URL, a log, storage, a seed, sync or a scenario is a build error.
Element secrecy after a spread is enforced at compile time: what
[...s],for…of,Array.from, destructuring or an array's own methods take out of a secret array is a secret to the compiler at every sink, while at run time those elements are plain values. A sink the compiler cannot see is out of scope; a call it cannot resolve — a moduleimport()loads, a global's value, a function passed in, a package's function — isQX-SECRET-ESCAPES-UNCHECKED(an error with--strict-secrets).
What it does not protect against
- Malware on the device, or anyone using the device while the vault is unlocked. An unlocked
device holds its session for 12 hours by default.
vault.lock()ends it sooner. - Script running in the page: cross-site scripting, a malicious dependency, a compromised CDN,
or the server sending different JavaScript. Such a script reads what the vault decrypts.
QX-VAULT-NO-CSP, the build's strict policy and SRI make an injected script harder to run, and the page refuses an asset that differs from the one it was built with. None of that helps when the server that sends the page is the attacker. - A compromised passkey provider, or a passkey synced to an account an attacker controls.
- A weak passphrase, on a device an attacker has. PBKDF2 at 600,000 rounds slows guessing; it does not stop it. That is why a passphrase is said to be weaker, and why it is never sent to the server.
- Metadata. The server and the relay see who has a vault, the stores' names, how many records and operations there are, their sizes and their times.
- Losing the keys. Without a passkey, the recovery code (or, with escrow, this device and the operator), nobody can open the vault.
What we do not claim
We do not call this end-to-end encrypted (E2EE): that name waits for an external audit.
What it is built from
WebCrypto only, and no cryptographic primitive of Qat's own: AES-256-GCM (96-bit random nonces,
checked against every nonce the page issued under the key), HKDF-SHA-256, PBKDF2-SHA-256 (600,000
rounds) and WebAuthn's PRF extension. Keys are non-extractable CryptoKeys, except on the recovery
path (making the vault, and typing its code back). The recovery code uses BIP-39's word list and
checksum, but not its seed derivation. The code is in packages/vault/src/ (about 600 lines with
its comments), and its tests are in packages/vault/test/ and examples/vault-notes/e2e/.