Threat model: what is not protected
11.1 Cross-site scripting (XSS)
Section titled “11.1 Cross-site scripting (XSS)”Threat: injected JavaScript in the same origin can call seal(), unseal() and loadCryptoKey() directly, and use
the app’s CircleClient and SyncEngine. Non-extractable CryptoKey objects can’t have their bytes read, but the
attacker can still use them to encrypt, decrypt or sign anything, and can read what sits in the app’s storage: the
Secret Key, synced records, the keyring.
Why Conseal can’t fix this: XSS breaks the browser’s same-origin boundary. Once arbitrary JavaScript runs on your page, it can use every API, Conseal’s included, as legitimately as your own code. This is an application-layer problem, and the same goes for a device that is compromised while unlocked: it holds the AEK.
Caller responsibility: a strict Content Security Policy, sanitised user-supplied HTML, and OWASP’s XSS prevention guidelines. Don’t run untrusted scripts in the same origin as the encrypted data.
11.2 A compromised server that serves the code
Section titled “11.2 A compromised server that serves the code”Threat: an attacker who controls the server can also control the page the user loads, and serve JavaScript that logs the passphrase before wrapping, or sends the AEK away.
Why Conseal can’t fix this: Conseal wraps keys on the client, but if the attacker controls how the page is delivered they can serve modified JavaScript. This is the classic way a server compromise breaks client-side crypto.
Caller responsibility: Subresource Integrity (SRI) for every script, a platform with tamper-evident deployments, and monitoring for unexpected changes to the JavaScript you serve. Serving the app from somewhere other than the sync server narrows who can do this.
11.3 Side channels
Section titled “11.3 Side channels”Threat: timing, cache-timing, power analysis or electromagnetic attacks on the cryptographic operations.
Why Conseal can’t fix this: these attacks target the hardware or the browser’s SubtleCrypto implementation.
Conseal has no influence over CPU caches, OS schedulers or physical hardware. Mitigating Spectre-class attacks is the
browser vendors’ and the OS’s job.
Caller responsibility: if your threat model includes nation-state physical access, Conseal isn’t the layer to address it.
11.4 Keys in JavaScript memory
Section titled “11.4 Keys in JavaScript memory”Threat: key material that passes through JavaScript, such as the passphrase string or raw bytes during wrapping, may stay in memory where a memory-scanning attacker finds it.
What Conseal does: the AEK and wrapped keys stay native CryptoKey objects wherever possible. Raw bytes exist only
briefly, during wrapping and unwrapping.
What it can’t do: JavaScript has no manual memory management. Strings and Uint8Arrays can’t be zeroed; the
garbage collector decides when memory is freed.
11.5 Weak passphrases
Section titled “11.5 Weak passphrases”Threat: a passphrase from a small dictionary (“123456”, “password”) shrinks the key space, whatever the iteration count. The same holds for a sealed backup’s passcode.
Conseal’s position: passphrase quality is the app’s policy. Conseal doesn’t measure entropy.
Caller responsibility: enforce a minimum length and strength, or use generateSecretKey(), which makes the
iteration count irrelevant to a server’s brute force.
11.6 Losing the Secret Key and the mnemonic
Section titled “11.6 Losing the Secret Key and the mnemonic”Threat: if the Secret Key is lost (the device destroyed, storage cleared, no backup) and the user hasn’t kept their mnemonic, the AEK can’t be recovered, and everything sealed under it is gone for good.
This is by design. The server can’t recover the AEK on the user’s behalf; that is what zero knowledge means.
Caller responsibility: clear UX that has users keep their mnemonic and Secret Key before anything destructive, and a recovery step during setup.
11.7 Exposing the mnemonic
Section titled “11.7 Exposing the mnemonic”Threat: the 24 words are a complete export of the AEK. Whoever has them can rebuild the AEK and open everything.
Conseal’s position: the mnemonic is for offline backup: on paper, or in a password manager. It should never travel unencrypted or show without the user asking.
Caller responsibility: show it only on request, have the user acknowledge what it is, and never log it or send it to a server.