Repository Public
1# Threat model23## Assets451. Content of messages, attachments and calls.62. Encryption identities (identity keys, device keys, group states).73. Accounts (who can sign in, who is invited).84. Metadata (who talks to whom, when, how much).95. Availability.1011## Adversaries and outcome1213| Adversary | Can | Cannot |14|---|---|---|15| **Network attacker** (Wi-Fi, ISP) | See that a device talks to `message.spboucher.ai` and to the TURN relay; see traffic volume and timing | Read or alter anything: TLS to the gateway, WireGuard gateway→node, MLS inside, DTLS-SRTP for calls |16| **Honest-but-curious server administrator / database or backup thief** | Read accounts, usernames, public keys, membership of every conversation, timestamps, sizes, delivery acknowledgements, typing and presence events, IP addresses in session and audit records | Read message text, reactions, read receipts, group names, file content, file names, thumbnails, call media. No decryption key is stored server-side |17| **Malicious server (actively lying)** | Withhold, delay or drop messages; refuse service; remove an account from the member list (clients then remove it: denial of service); list a false member (**ignored for key distribution**: clients only extend the group to accounts already inside it); advertise a false device (**refused**: no certificate from the pinned identity key); advertise a *new identity key* for an account (**warning**, not used until accepted) | Add a reader to an existing conversation without a visible key-change warning that a person accepts; forge a message from a member; replace a working group state on a device (welcomes are accepted only by devices holding no state); substitute keys during device approval without changing the code the person compares |18| **Malicious server delivering altered web code** | **Everything.** A web application is served by the server at each visit; altered JavaScript could exfiltrate keys. CSP and same-origin scripts limit third parties, not the origin itself | — This is the main residual risk of any web-delivered E2EE application. Native apps with signed binaries remove it |19| **TURN relay operator** | See which IP addresses exchange media and how much | Decrypt media (DTLS-SRTP end to end; fingerprints exchanged inside MLS) |20| **Member of a conversation** | Read what is sent while a member; keep copies; send malformed content (validated before display) | Impersonate another member (signatures per device); edit or delete someone else's message; read messages sent after removal |21| **Removed member / revoked device** | Keep what it already decrypted | Decrypt anything sent after the commit that removed it; fetch ciphertext (membership check) |22| **Someone with an invitation link** | Create one account per remaining use | Reuse a spent, expired or revoked link; join conversations (must be added by a member) |23| **Thief of an unlocked device** | Read local history; send as the owner until the device is revoked | Use the passkey without Face ID/Touch ID/device code; extract the IndexedDB wrapping key as raw bytes (non-extractable) — though code running in that browser profile can use it |24| **Thief of the recovery key alone** | Nothing without also signing in with a passkey of the account | — |25| **Thief of a passkey alone** (synced keychain compromise) | Sign in, see the conversation list, request a device link | Read any message: needs approval from a trusted device (code comparison) or the recovery key |2627## Design decisions that follow2829- Authentication keys and encryption keys are separate; compromise of one does not give the other.30- Tokens (session, invitation, bootstrap) are random 256-bit values stored only as SHA-256; invitation and bootstrap31 tokens travel in the URL fragment and in request bodies, never in a path or query string, so proxies do not log them.32- Logs record method, path and status. The audit log records administrative and security events with no content.33- Notifications never include message text.34- Disappearing messages are deleted on the server at expiry as well as on devices (a recipient can still copy them).3536## Residual risks, stated plainly37381. `ts-mls` has had **no independent security audit**. The protocol is standard; this implementation is young.392. **Web delivery trust** (above).403. **Metadata** is visible to the server by design (membership, timing, sizes). No sealed sender, no padding policy41 beyond the library default.424. Local history in IndexedDB is stored decrypted (secrets are wrapped, messages are not). Device disk encryption and43 the device lock are the protection.445. Trust on first use: until two people compare safety numbers, a server that lied from the very first contact would45 not be detected.466. One-time key packages can run out; the last-resort package is then reused, which weakens forward secrecy for that47 one join until the device comes back online and uploads new packages.487. Denial of service by the server or by a flooding member is not prevented, only rate-limited.498. No protection against screenshots, compromised browsers or malicious extensions.50