SPB Git

Repository Public

THREAT-MODEL.md 5.0 KB

# Threat model

# Assets

  1. Content of messages, attachments and calls.
  2. Encryption identities (identity keys, device keys, group states).
  3. Accounts (who can sign in, who is invited).
  4. Metadata (who talks to whom, when, how much).
  5. Availability.

# Adversaries and outcome

Adversary Can Cannot
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
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
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
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
TURN relay operator See which IP addresses exchange media and how much Decrypt media (DTLS-SRTP end to end; fingerprints exchanged inside MLS)
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
Removed member / revoked device Keep what it already decrypted Decrypt anything sent after the commit that removed it; fetch ciphertext (membership check)
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)
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
Thief of the recovery key alone Nothing without also signing in with a passkey of the account —
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

# Design decisions that follow

  • Authentication keys and encryption keys are separate; compromise of one does not give the other.
  • Tokens (session, invitation, bootstrap) are random 256-bit values stored only as SHA-256; invitation and bootstrap tokens travel in the URL fragment and in request bodies, never in a path or query string, so proxies do not log them.
  • Logs record method, path and status. The audit log records administrative and security events with no content.
  • Notifications never include message text.
  • Disappearing messages are deleted on the server at expiry as well as on devices (a recipient can still copy them).

# Residual risks, stated plainly

  1. ts-mls has had no independent security audit. The protocol is standard; this implementation is young.
  2. Web delivery trust (above).
  3. Metadata is visible to the server by design (membership, timing, sizes). No sealed sender, no padding policy beyond the library default.
  4. Local history in IndexedDB is stored decrypted (secrets are wrapped, messages are not). Device disk encryption and the device lock are the protection.
  5. Trust on first use: until two people compare safety numbers, a server that lied from the very first contact would not be detected.
  6. One-time key packages can run out; the last-resort package is then reused, which weakens forward secrecy for that one join until the device comes back online and uploads new packages.
  7. Denial of service by the server or by a flooding member is not prevented, only rate-limited.
  8. No protection against screenshots, compromised browsers or malicious extensions.
Files main
Menu

Theme