|
Download docs/operator-handover.md from abr00kx/taper: direct link, hf CLI and curl.
- Browser
- Download file 42.5 kB
-
https://huggingface.co/abr00kx/taper/resolve/main/docs/operator-handover.md
- Command line
-
hf download hf://abr00kx/taper/docs/operator-handover.md
-
curl -L -o operator-handover.md https://huggingface.co/abr00kx/taper/resolve/main/docs/operator-handover.md
42.5 kB
| # What an operator can be forced to hand over | |
| **Status:** written 2026-11-23 against the prototype in `server/`, `client/` | |
| and `desktop/` on branch `taper/rebrand-and-retention`, and re-checked the | |
| same day against `server/index.js`, `server/store.js`, `server/admin.js`, | |
| `client/device.js`, `client/account.js` and `desktop/taper_desktop/`. That | |
| covers security keys, room-key backup, password change, account deletion, | |
| persistent devices and the admin command line. The page can go stale: re-check | |
| it against the code before a release. | |
| This page is for operators, users and legislators. It says what a Taper | |
| server holds, in what form, for how long, and what a person could get from | |
| it by seizing a disk, seizing a disk and the keys, taking over the running | |
| machine, or serving a legal order on the operator. It also says what the | |
| server never has. Where Taper falls short, it says so | |
| ([Things we have not solved](#things-we-have-not-solved)). | |
| **This is not legal advice.** Taper's authors are not lawyers. The page | |
| describes technical facts. It does not say what a court can order or what an | |
| operator must do. Questions for a lawyer are at the end. | |
| ## Four ways of getting at a server | |
| | Short name | What the person has | | |
| |------------|---------------------| | |
| | **Disk** | A copy of the data directory (`TAPER_DATA_DIR`): the SQLite files `taper.db`, `taper.db-wal` and `taper.db-shm`. This is what a stolen laptop, a seized disk, or a backup of the data directory gives. | | |
| | **Disk + keys** | The data directory and the key directory (`TAPER_KEY_DIR`): the daily keys `<n>.key` and `opaque.secret`. Taper is built so that nobody holds both in the same place, but an operator who is made to hand over everything hands over both. | | |
| | **Running machine** | Root on the live server, or an image of its memory. Everything the process has in memory is available. | | |
| | **Order** | A legal order served on the operator. The operator can produce whatever they can read: that is the "Running machine" column for an operator who runs the server. An order can also require changing the software to collect more from now on. See [Orders that look forward](#orders-that-look-forward). | | |
| ## At a glance | |
| "Plain" means readable by anyone with the disk. "Sealed" means AES-256-GCM | |
| under a daily key from the key directory. "Opaque" means encrypted or hashed | |
| by the user's device with a key the server never has. | |
| | Category | Form on disk | How long | Disk | Disk + keys | Running machine | | |
| |----------|--------------|----------|------|-------------|-----------------| | |
| | Account record | Plain | Until the account is removed. Nothing removes it automatically | User ID, creation time, OPAQUE record | Same | Same | | |
| | OPAQUE record | Plain, but a password verifier, not a password | As above | Material for guessing passwords, useless without the OPAQUE secret | Offline password guessing is possible | Same | | |
| | Access tokens | Plain rows holding the SHA-256 of the token | Until logout, revocation, or the minute-by-minute purge after the token expires | User, device, expiry. Not the token | Same | Same, and tokens as they arrive from clients | | |
| | Suspension records | Plain | Until the operator lifts the suspension, or the account is deleted | User ID and time of each suspended account | Same | Same | | |
| | Deleted-user records | Plain | For ever | User ID and time of each deleted account | Same | Same | | |
| | Security-key records | Plain | Until removed | Credential ID, public key, counter, nickname, level, creation time, the site it was registered for | Same | Same | | |
| | Identity-recovery blob | Plain row, contents opaque | Until replaced | Ciphertext | Ciphertext, but see [Password guessing](#password-guessing) | Ciphertext | | |
| | Room-key backup | Opaque, in parts named for the upload day, and also sealed under a daily key | 21 days after the start of each part's day | User ID, day and part number of each part, and its size | Ciphertext, but see [Password guessing](#password-guessing) | Ciphertext | | |
| | Events and messages | Sealed, with plain labels | Message events 21 days. State events as long as they are current | Room ID, event ID, depth, day, size. Not content | Everything the server sees, not the message text | Same | | |
| | Room state | Sealed, re-sealed daily | As long as the room exists | Same labels as above | Membership, join rules and the other plain state types | Same | | |
| | Media | Sealed ciphertext | 21 days | Media ID, day, size | Encrypted files, and the uploader's user ID | Same | | |
| | To-device queue | Sealed, with plain labels | Until delivered, or 21 days | User ID and device ID of every device with undelivered messages | Message type and sender; the content is end-to-end encrypted | Same | | |
| | Device keys, one-time keys, cross-signing public keys | Plain | Until the device logs out, is revoked, or its last token has expired and been purged | Public keys, device IDs | Same | Same | | |
| | Federation peer data | Configuration in the environment; key documents in memory | The life of the process | Not on disk | Not on disk | Peer names and URLs, their cached key documents | | |
| | Connection data and logs | **Not stored by Taper** | | Nothing | Nothing | Live connections; IP addresses only at the network layer | | |
| | Server signing key | Memory only | The life of the process | Not on disk | Not on disk | Yes | | |
| | TLS key | Wherever the operator put it | Operator's choice | Not in the data directory | Not in the key directory | Yes | | |
| | Onion service key | Tor's `HiddenServiceDir` | Permanent | Not in the data directory | Not in the key directory | Yes | | |
| | OPAQUE server secret | `keys/opaque.secret`, plain | Permanent | No | Yes | Yes | | |
| | Daily keys | `keys/<n>.key`, plain | About 22 days after the end of their day | No | Yes | Yes | | |
| | Backups | Whatever the operator makes | Operator's choice | See the section | See the section | | | |
| ## Category by category | |
| ### Account record | |
| **Held:** for each account, the user ID (`@name:server`), the creation time | |
| and the OPAQUE record (below). Stored in the `records` table, namespace | |
| `users`, as plain JSON. | |
| **Not held:** a password, a password hash the server could check by itself, | |
| an e-mail address, a phone number, a display name or an IP address. There is | |
| no field for any of them. | |
| **How long:** nothing in the server removes an inactive account. A user can | |
| delete their own account (`t.account.delete`: it needs the password, and a | |
| security key if they have one), and the operator's admin command line can | |
| suspend, unsuspend and delete accounts (see [Operator tools](#operator-tools)). | |
| Deleting uses one function for both: it removes the account record, tokens, | |
| device keys, queued to-device messages, the identity-recovery blob, | |
| cross-signing keys and their signatures, security-key records, the key | |
| backup parts and the usage counters. It does **not** remove everything: | |
| - The account leaves its rooms, and each "leave" is appended as a membership | |
| event. That event stays in the room state, like any member's. Events the | |
| account already sent stay until they expire. | |
| - A **record of the deletion** is kept for ever in the plain records (the | |
| `deleted_users` namespace): the user ID and the time. It stops anyone | |
| registering the name later and passing for the old owner. It also shows | |
| that the account existed and when it ended. | |
| **Suspension.** A suspended account can't log in, and its devices are signed | |
| out. The suspension is stored as a plain row (user ID and time), so it | |
| survives a restart. The server's log says that a suspension happened, never | |
| whose. | |
| **What it shows:** the list of everyone who has an account, and when each | |
| registered. That list is readable from the disk alone. | |
| ### OPAQUE record | |
| **Held:** one 192-byte OPAQUE registration record per account, in the account | |
| record. It is not a password hash that anyone can test a guess against. To | |
| test a guess, a person needs the record **and** the server's OPAQUE secret | |
| (the OPRF seed and key pair in `keys/opaque.secret`), and must run the | |
| client's Argon2id step (64 MiB, 3 passes, 4 lanes) for each guess. | |
| | Has | Can do | | |
| |-----|--------| | |
| | Disk only | Nothing useful. Without the secret, guesses can't be tested offline | | |
| | Disk + keys | Test password guesses offline, one account at a time, at the cost of an Argon2id run per guess. A weak password falls; a long random one doesn't | | |
| | Running machine | The same as disk + keys, and can watch the next logins | | |
| See [Password guessing](#password-guessing) for why this matters. | |
| **How long:** until the account is removed. Changing the password replaces | |
| the record (`t.password.change.finish`). | |
| ### Access tokens | |
| **Held:** a 256-bit random token is given to the client. The server keeps | |
| only its SHA-256 hash, with the user ID, device ID and expiry time (7 days by | |
| default, `TAPER_TOKEN_TTL_MS`; a token in use is renewed, but never past | |
| `TAPER_TOKEN_MAX_MS`, 30 days by default, after it was issued). The token itself cannot be recovered from | |
| the disk. | |
| **What it shows:** the hash plus the expiry time reveals roughly when each | |
| device last logged in (expiry minus the lifetime). Every device a user has | |
| logged in on is listed by device ID. | |
| **How long:** the row is deleted when the user logs out, and when an expired | |
| token is presented. The server also purges expired tokens every minute | |
| (`purgeExpired` in `server/index.js`), together with the device keys that only | |
| those tokens kept alive. **One gap remains:** a token that expired *while the | |
| server was stopped* is not loaded at start-up, so the purge never sees it. | |
| Its row, and the device keys it kept, stay on disk. That is a bug, listed | |
| below. | |
| The admin tool can revoke every token and device key of an account | |
| (`revoke`), and "Wipe this device" revokes the token of that device when the | |
| device is unlocked and can reach the server. Wipe from the lock screen can't: | |
| the token is still sealed there, so it lapses on its own after its lifetime. | |
| **Running machine:** tokens in use pass through the process in the clear | |
| while a client identifies. Someone who can read the memory of the live | |
| process can see tokens as they arrive. They can use them until they expire | |
| or are revoked. Sensitive actions need fresh proof of the password (and a touch of a | |
| security key if the account has one), so a stolen token alone does not allow | |
| them: replacing the identity copy or the cross-signing identity, changing the | |
| password, adding or removing a key, changing the login rule, and deleting the | |
| account. | |
| ### Security-key records | |
| An account may hold up to 8 keys. **Held, per registered key:** the credential ID, the COSE public key, the | |
| signature counter, a creation time, the nickname the user chose, and a | |
| level: *attested* (the attestation chain verified to a root the operator | |
| configured) or *unattested*. The server discards the attestation | |
| certificate, the AAGUID and the serial number straight away, because | |
| together they would work as a fingerprint of the physical key. | |
| **Where:** the plain `records` table, namespace `webauthn`, one row per | |
| account. The row also holds the user's two settings (show the indicator, and | |
| require a key at login) and, for each key, the host name of the site it was | |
| registered for. The disk alone therefore shows which accounts have keys, | |
| how many, their nicknames, their levels and creation times, and which | |
| accounts show the indicator. | |
| **What it can't do:** a public key and a counter cannot sign anything. They | |
| let a person check signatures, not make them. Seizing them does not give | |
| anyone a way to act as the user. | |
| **What it shows:** the nickname is chosen by the user and may say something | |
| ("work phone"). Users should be told not to put anything in it they would | |
| not want an operator to read. | |
| **Unattested unless you install roots.** The server ships no attestation | |
| roots. `TAPER_WEBAUTHN_ROOTS` is empty by default, so every key is | |
| "unattested" until the operator installs roots they trust. A key also works | |
| only on the host name where it was registered, and an IP address is not | |
| valid, so a server reached by IP address can't use security keys. | |
| **The indicator:** a user can opt in to a badge, "🔑 key (checked)" for an | |
| attested key and "🔑 key" for an unattested one. It is shown to people who | |
| share a room with them and, through federation, to peers that ask about the | |
| server's own users. It is not on a public profile. See | |
| [the threat model](threat-model.md#what-the-security-key-indicator-does-and-doesnt-mean). | |
| ### Identity-recovery blob | |
| **Held:** one blob per account, `{algorithm, iv, ciphertext}`, at most 16 KiB. | |
| It holds the three cross-signing private keys, sealed by the user's device | |
| with AES-256-GCM under a key derived (HKDF-SHA-512) from OPAQUE's | |
| `export_key`. The server checks the shape only. It stores the blob in the | |
| plain `records` table, so the ciphertext is on the disk without a daily | |
| key. | |
| **Cannot be opened by:** the disk, or the disk plus keys, without the user's | |
| password. **Can be opened by:** a person who has the disk, the keys and a | |
| correct guess of the password (see below). The identity keys let them sign | |
| new devices for that user. | |
| **How long:** until the user replaces it. Replacing needs a fresh proof of | |
| the password. Password change re-seals it under the new export key. | |
| ### Room-key backup | |
| **Held:** Megolm room keys, uploaded by the client, encrypted under a key | |
| derived from the OPAQUE export key. The server never sees that key. They are | |
| stored in *parts*, named for the UTC day of upload and a number | |
| (`2026-01-31.0`). The server accepts only today's and yesterday's day, and | |
| drops each part 21 days after the start of its day, as it does messages, so | |
| a backed-up key does not outlive the messages it opens by more than the days | |
| between receiving a key and uploading it. A part holds at most 512 KiB of | |
| ciphertext, and an account at most 200 parts and 8 MiB. The client turns the | |
| backup on by default and the user can turn it off in Settings, which calls | |
| `t.backup.clear` and forgets every part. | |
| **Where:** each part is a sealed row under the key of the day it was | |
| written, so daily key destruction covers it as well as the 21-day expiry. The | |
| plain label of the row is `user_id|part` (for example | |
| `@alice:example.org|2026-01-31.0`), so the disk alone shows which accounts | |
| have backups, for which days, and how many parts each day. | |
| **The point to understand:** the backup is the first place where a thing the | |
| server holds can open message content. It is sealed by the user's password | |
| through OPAQUE. A person with the disk, the keys and a correct guess of the | |
| password can open the backup, get the room keys, and read every message | |
| from the last 21 days whose ciphertext they also have. The ciphertext is on | |
| the same disk, sealed under the daily keys that this person holds. See | |
| [Password guessing](#password-guessing). | |
| ### Events and messages | |
| **Held, per event:** the room ID, the sender's user ID, the event type, the | |
| server timestamp in milliseconds, the depth (a counter in the room), the | |
| previous event IDs, the event ID, and the origin server's signature. For a | |
| message (`t.room.encrypted`), the content is the Megolm ciphertext, the | |
| Megolm session ID, the 128-bit binding, and the list of attachment content | |
| URIs, if any. The server also stores any other fields the client leaves | |
| outside the ciphertext, because it stores the content object it receives. | |
| The server reads an edit relation (`t.relates_to`) if a client sets one, so | |
| that it can redact edits with the original. The current client does not set | |
| one. | |
| **Form:** the whole event is sealed with AES-256-GCM under the key for the | |
| day it was sent. The database row carries labels in plain: the event ID, the | |
| room ID, the depth, the day number, and the length of the sealed data. | |
| | Has | Can read | | |
| |-----|----------| | |
| | Disk only | Per room: how many events, on which days, with what sizes, and the depth counter. The sender, type and content are sealed. The labels are not | | |
| | Disk + keys | All of the event fields above, for every event still held. Not message text | | |
| | Running machine | The same, live, plus the connection each event arrived on | | |
| **Message text:** never held. It is encrypted by the sender's device with | |
| Megolm. The server does not have the room keys. The exception is room-key | |
| backup, above. | |
| **How long:** the server removes message events 21 days after they were | |
| sent (it checks every minute, `TAPER_RETENTION_MS` may only make this | |
| shorter). It deletes the row, and with `secure_delete` on, SQLite overwrites | |
| the freed space. The daily key goes later, so that a copy of the database | |
| taken before is unreadable once the key is gone. | |
| **Redaction:** a redacted event keeps only its envelope (sender, type, time, | |
| depth, previous events) and the binding. The ciphertext and session ID are | |
| removed from the stored copy. Edits by the same sender are redacted with the | |
| original. | |
| **Two days of margin:** the daily key is destroyed when its day ended more | |
| than 22 days ago, not 21: the code keeps one extra day of margin. A message | |
| from the start of a day expires after 21 days, but its key survives until | |
| about 23 days after it was sent. A copy of the database made before the | |
| message expired, together with a copy of the key directory made before that | |
| day's key was destroyed, still opens it for up to two days after it expired. | |
| ### Room state | |
| **Held:** the current state events of each room: creation, the memberships | |
| of every user who has ever joined or been invited (the latest event for | |
| each, including "leave"), join rules, history visibility, encryption | |
| settings, and the encrypted state events (room names and topics, which the | |
| server sees as `t.room.encrypted` with a type label only). | |
| **Form:** sealed like events, but **re-sealed under the current day's key | |
| every day**, so that no key is needed past the 21 days. That also means | |
| the keys for old state never get destroyed while the room exists: state is | |
| always under a recent key. | |
| **What it shows to disk + keys, or the running machine:** for every room, | |
| the list of current `join`, `invite` and `ban` members. Superseded membership | |
| events and expired `leave` events are purged after the room's retention period | |
| (up to 21 days), and empty rooms with no remaining `join`, `invite` or `ban` | |
| members are deleted once their events expire. Active rooms still expose their | |
| current membership to the server. | |
| **This is the most sensitive thing the server keeps for long.** See | |
| [Things we have not solved](#things-we-have-not-solved). | |
| ### Media | |
| **Held:** the uploader's user ID, the size, the creation time and the file. | |
| The file is encrypted by the client (AES-256-CTR, a random key per file, | |
| padded to a Padmé size) before upload. The file key is inside the end-to-end | |
| encrypted message that mentions it. The server holds only ciphertext. | |
| **Form:** sealed (base64 inside the sealed record) under the key for the day | |
| of upload. Disk-only shows the media ID, the day and the size. The size is | |
| that of the padded ciphertext (the client pads to a Padmé bucket before | |
| encrypting), so it reveals a size range, not the exact length. | |
| **How long:** 21 days. | |
| ### To-device queue | |
| **Held:** messages for a device that was offline: sender, event type and | |
| content. The content is end-to-end encrypted (Olm). The server cannot read | |
| it. It is held until the device connects, or 21 days. | |
| **Form:** sealed. The label for each queue is the plain string | |
| `user_id|device_id`, so the disk alone lists every device that currently has | |
| undelivered messages. | |
| ### Device keys, one-time keys, cross-signing public keys | |
| **Held:** each device's public identity and one-time keys, the fallback key, | |
| and each user's public cross-signing keys, with signatures. All are public | |
| keys that the server must hand out. They are in plain records. | |
| **How long:** deleted when the device logs out, when the operator revokes the | |
| account's devices, when the user changes their password (every other device), | |
| and when the device's last token has expired and been purged. While a device | |
| holds a live token, its keys stay. The disk therefore lists the devices an | |
| account has used in the last token lifetime (7 days by default), and, because | |
| of the start-up gap in [Access tokens](#access-tokens), possibly older ones. | |
| ### Federation peer data | |
| **Held:** the list of peers is configuration (`TAPER_FEDERATION_PEERS` in the | |
| environment file). Peer key documents are fetched when needed and cached | |
| in memory for a minute. Neither is written to the database. | |
| **What an operator has about other servers:** a copy of every event for | |
| every room that has a member on our server, and the state of those rooms. | |
| Those events are stored the same way as local ones. See | |
| [Things we have not solved](#things-we-have-not-solved) for the other | |
| direction: what other servers hold of ours. | |
| **Retired request keys** are published with their private halves at | |
| `{federation path}/keys`, on purpose. Nobody can prove from a recorded | |
| federation handshake that it came from this server. | |
| ### Connection data and logs | |
| **Held by Taper:** nothing on disk. The server does not log connections, | |
| requests, user IDs or IP addresses. It writes to the system log only: a start-up line (with the first 5 | |
| characters of the gateway path), "Restored N users and M rooms", certificate | |
| reload messages, and errors. Some errors name a peer server and an event ID | |
| (for example, "sending $... to server failed"). It keeps per-account | |
| counters for scraping limits and login attempts **in memory only**, which are | |
| lost when the process stops. Those counters hold counts, not room IDs or | |
| content. | |
| **What exists anyway:** | |
| - **On the clear net,** the operating system and the network see the client's | |
| IP address and port for each connection: in the kernel's connection | |
| table, in the host's firewall and flow logs, in the hosting provider's | |
| network records, and in any reverse proxy, load balancer or CDN the | |
| operator puts in front. Taper has no control over those. Someone who | |
| takes over the running machine can list live connections with a standard | |
| tool. | |
| - **The domain name** is public in DNS and in certificate transparency logs | |
| (if the certificate comes from a public CA). The gateway path is secret and | |
| is not in either. | |
| - **On Tor,** Taper sees connections from the local Tor process (`127.0.0.1`). | |
| There are no client IP addresses to give. See | |
| [Hosting on Tor](#hosting-on-tor). | |
| Taper does not stop an operator from turning on logging in front of it, | |
| and it can't see if they do. | |
| ### Server signing keys | |
| **Held:** the server's Ed25519 event-signing key (persisted in | |
| `TAPER_KEY_DIR/signing.secret` when storage is on, or memory-only otherwise) | |
| and its short-lived federation request keys (memory only). The signing key | |
| can be rotated with `admin.js rotate-signing-key`, which keeps the old public | |
| key in `old_verify_keys` with a signed continuity proof for 21 days so peers | |
| that pin keys can verify the transition. See | |
| [compromised keys](design/compromised-keys.md). | |
| **What a signature shows:** the server signs each event's *redacted* form: | |
| sender, type, time, depth, previous events, room. The signature covers no | |
| message content (room version 13). | |
| ### TLS and onion service keys | |
| **Held:** outside Taper. The TLS private key is wherever the operator puts | |
| it (the systemd unit expects `/etc/taper/tls/privkey.pem`, mode 0640, group | |
| `taper`). The onion service secret key is in Tor's `HiddenServiceDir` (for | |
| example `/var/lib/tor/taper/hs_ed25519_secret_key`). Both are plain files. | |
| Anyone who has them can impersonate the server (see | |
| [compromised keys](design/compromised-keys.md)). Neither opens past traffic: | |
| TLS 1.3 key exchange is ephemeral, and Tor's is too. | |
| ### Daily keys, and the OPAQUE secret | |
| **Held:** in `TAPER_KEY_DIR`, as plain files with mode 0600: one 32-byte key | |
| per day, and `opaque.secret`. | |
| - The daily keys are destroyed (overwritten with random bytes, flushed, | |
| deleted) when their day ended more than 22 days ago. The server checks | |
| when it starts and every minute. | |
| - `opaque.secret` is not destroyed. Without it every user is locked out. | |
| - A destroyed key can't be recovered *by Taper*. A disk may still hold the | |
| old key's blocks, a snapshot, or a backup. See [Backups](#backups). | |
| ### Backups | |
| Taper makes no backups. The operator does. | |
| The deploy guide says to back up the data directory, and `opaque.secret` | |
| separately, and never the daily keys. If an operator follows it: | |
| - A data backup holds the plain records (accounts, OPAQUE records, token | |
| hashes, public keys, identity-recovery blobs, security-key records, | |
| suspension records and deleted-user records) **indefinitely**, because those | |
| are never shredded. That includes accounts a user has since deleted, and | |
| keys they have since removed: a restore brings them back. Backups also hold | |
| sealed rows (messages, queues, key-backup parts) that can't be opened once | |
| their keys are gone. After a restore without the daily keys, the sealed | |
| rows are lost, and users' clients upload their room keys again. | |
| - A backup of `opaque.secret` together with an old data backup allows | |
| offline password guessing against the accounts in that backup. | |
| - Backing up the daily keys defeats the 21-day limit. The operator can't be | |
| stopped from doing it. The server does not know. | |
| Filesystem snapshots (LVM, ZFS, btrfs), RAID mirrors, SSD wear-levelling | |
| and hosting-provider disk snapshots can keep a copy of a key file after it is | |
| "deleted". Overwriting the key file before removing it helps only on a plain | |
| overwrite-in-place disk. Taper has no mode that keeps daily keys in memory | |
| only. Both the daily keys and `opaque.secret` are in `TAPER_KEY_DIR`, and | |
| losing `opaque.secret` locks every user out, so putting the whole directory | |
| on a RAM-backed filesystem is not a fix. | |
| ### Process memory of a running server | |
| The process holds, decrypted and in memory: | |
| - every account, token hash, device key and identity-recovery blob; | |
| - every event it still keeps, in the form the server sees them (sender, | |
| room, time, ciphertext), media files, and to-device queues; | |
| - the daily keys it has used, until they are destroyed; | |
| - the OPAQUE secret; | |
| - the server signing key and request keys; | |
| - the TLS private key; | |
| - recent dispatches for each session, for resuming a dropped connection | |
| (up to 1000 per session, kept 5 minutes after a disconnect); | |
| - scraping counters and recent login attempts. | |
| Someone with root, or with the ability to read the process's memory, gets all | |
| of it. The systemd unit sets `LimitCORE=0` (no core dumps) and hides other | |
| processes. It does nothing about swap, hibernation images or a hypervisor that | |
| can read the guest's memory: those can write memory to disk or expose it. | |
| Taper does not lock its memory. | |
| ### Operator tools | |
| `server/admin.js` talks to a running server over a Unix socket | |
| (`TAPER_ADMIN_SOCKET`, created with mode 0600, so only the account that runs | |
| the server, and root, can open it). Nothing is reachable from the network. | |
| Commands: | |
| | Command | What it does | | |
| |---------|--------------| | |
| | `users` | Lists accounts: user ID, creation day, whether suspended, how many security keys | | |
| | `stats` | Counters: users, rooms, sessions, suspended accounts, current limits | | |
| | `suspend USER` / `unsuspend USER` | Signs the account out and stops login / lifts that. The suspension is stored | | |
| | `revoke USER` | Signs every device out: tokens and device keys | | |
| | `unlock USER` | Clears a user's security keys and login rule, and signs them out. For someone who lost every key | | |
| | `delete USER` | The same function as the user's own account deletion | | |
| | `invite [TTL_HOURS]` | Creates a single-use, expiring registration invite token (stores only its SHA-256 hash and expiry) | | |
| | `rotate-signing-key` | Rotates the server's Ed25519 event-signing key and publishes a signed continuity proof in `old_verify_keys` | | |
| | `limits [NAME VALUE]` | Shows or changes `registration_open`, `invite_only`, `register_pow_bits`, `rate_burst`, `rate_per_sec`, `budget_scale`. Changes are live and are **not** kept across a restart | | |
| **`unlock` is a way round the keys.** Anyone who can persuade an operator can | |
| use it to remove a user's second factor, so the operator must check who is | |
| asking, by a route other than Taper. It doesn't open anything: the user still | |
| needs their password. | |
| These commands don't show message content, because the server has none to | |
| show. The server's log records the action (`admin: suspend`), never the | |
| account. | |
| ## What an operator cannot hand over | |
| The server never has these. A court order cannot get them from the operator, | |
| because the operator does not have them. | |
| | Thing | Why the server never has it | | |
| |-------|-----------------------------| | |
| | **Message text** | Encrypted on the sender's device with Megolm. The server stores and relays ciphertext. The room keys go from device to device, inside Olm messages | | |
| | **Message authors' devices' keys** | Device private keys are generated and kept on the user's device. The server has the public halves | | |
| | **Identity (cross-signing) private keys** | Sealed on the device under a key from the password. The server holds the sealed blob. It cannot open it | | |
| | **Passwords** | OPAQUE: the password never leaves the device, not even during registration or login | | |
| | **Export keys** | Derived on the device from the password and the server's OPRF response. They never leave the device. They seal the identity blob and the key backup | | |
| | **Room keys** | Held on devices. The backup copy on the server is encrypted under a key the server never sees | | |
| | **Media content and its keys** | Encrypted on the device. The key is inside an encrypted message | | |
| | **Room names and topics** | End-to-end encrypted state: the server stores them as ciphertext | | |
| | **The private keys of security keys** | They never leave the authenticator | | |
| | **Local storage on a user's device** | It is on the device. With the default settings, nothing survives closing the tab (on the desktop, unless `--keep-data` was used). See [persistent devices](#persistent-devices) | | |
| | **Who read a message, or typed a message at a given moment** | The server stores no read receipts or typing state and sees no content | | |
| One honest limit: the server holds *what these are encrypted with*, only if | |
| the user's password is weak enough to guess. See | |
| [Password guessing](#password-guessing). | |
| ### Persistent devices | |
| By default, a client keeps nothing after the tab or the desktop app closes. | |
| On the desktop, the web view's storage is ephemeral unless the user ran | |
| `taper-desktop --keep-data` once (it creates `~/.config/taper/keep-data`; | |
| the data then lives in `~/.local/share/taper/webdata`, mode 0700; | |
| `--forget-data` deletes it). Keeping a device signed in on the desktop needs | |
| that. The desktop does not use the GNOME keyring or any other system | |
| secret store. | |
| Users can opt in to "keep this device signed in" (`client/device.js`). The | |
| gateway address, access token, crypto-store passphrase and backup key are then | |
| stored in browser storage as one record, sealed under a passphrase the user | |
| chooses (PBKDF2-HMAC-SHA-256, 600,000 iterations, AES-256-GCM). Nothing in | |
| the record is in clear text except the iteration count, salt, IV and | |
| ciphertext. The client's table of already-seen message indexes (its replay | |
| protection) is also kept, for kept devices only, sealed under a key derived | |
| from the crypto-store passphrase; entries older than 22 days are dropped. | |
| **Lock** forgets everything in memory and keeps everything on disk. | |
| **Wipe this device** calls `t.logout` first if the device is unlocked and | |
| connected (so the server revokes the token), then deletes the sealed record, | |
| the replay table and every `taper-crypto-*` IndexedDB store. There is no | |
| automatic wipe after failed attempts, and no idle auto-lock yet: a kept | |
| device stays unlocked until the user presses Lock or closes the page. The | |
| server has none of this. Someone who takes the *device* can guess the device | |
| passphrase offline, at the cost of 600,000 iterations per guess. | |
| ## Password guessing | |
| OPAQUE protects the password from the *server*, and from anyone who has | |
| only the disk. It does not protect a weak password from someone who has the | |
| disk **and** the key directory. That person has the OPAQUE record and the | |
| OPRF seed, so they can compute, for any guess, the same export key the user's | |
| device would compute. | |
| A correct guess gives them: | |
| 1. the export key, and with it the **identity-recovery blob**: the user's | |
| cross-signing keys; | |
| 2. the **room-key backup**: the Megolm keys for up | |
| to 21 days of messages. With the ciphertext, which is on the same disk and | |
| under keys they hold, they can read those messages; | |
| 3. the password, so they can log in as the user (a new login is a new | |
| device that other users see as new, and that has no access to old | |
| messages). | |
| They need one Argon2id run per guess per account. A random 6-word passphrase | |
| resists this. A short or common password does not. The client does not | |
| measure password strength, and the server can't: the forms ask for 8 | |
| characters at least, and the server enforces no minimum at all (it never | |
| sees the password). This is the largest way in | |
| which "seized the disk and the keys" can become "read messages", and the main | |
| reason the two directories must never be together. | |
| ## Hosting on Tor | |
| When the server is an onion service and not on the clear net: | |
| | Question | Answer | | |
| |----------|--------| | |
| | Client IP addresses | Taper sees `127.0.0.1` for every client (Tor's local connection). There is nothing to hand over. The operator's Tor process does not know them either | | |
| | Operator's own IP | Hidden from users. Not hidden from the hosting provider, who runs the machine. A legal order to the host can still reach the machine | | |
| | TLS key and certificate | Not needed. No certificate authority, and no certificate transparency record naming the server | | |
| | The server's name | The onion address *is* the server name (`@alice:<address>.onion`). It can't be changed. Whoever holds `hs_ed25519_secret_key` can run a server at that address | | |
| | Extra files to protect | `HiddenServiceDir`: the onion secret key, and the `authorized_clients/` directory if client authorization is used, which lists the public key of each invited user (or each invitation) | | |
| | Federation | Outbound connections go through Tor (`TAPER_TOR_SOCKS`), one set of circuits per peer, and peer names are resolved by Tor. Peers are named by onion address in the environment file | | |
| | What the network sees | A watcher near the *operator* sees that the machine talks to Tor. A watcher near a *user* sees that they use Tor (or a bridge). Neither sees the other end | | |
| | Tor itself | Tor's own configuration, state and logs are another set of files an order or a seizure can reach. Taper does not manage them | | |
| Hosting on Tor removes IP addresses from what an operator holds. It does | |
| not remove anything else on this page: accounts, room membership, event | |
| labels, timing and the state are the same. | |
| ## Orders that look forward | |
| Everything above describes what exists *now*. A court can also order an | |
| operator to change what exists: to log connections, to record who talks to | |
| whom, or to serve a modified client. Taper can't stop an operator who is | |
| made to do this: | |
| - **The web client is served by the server.** An operator can serve a | |
| modified client to one user. That client can read messages and steal the | |
| password. This is the weakness of every web messenger. See | |
| [signed releases](design/signed-releases.md) for the proposal, which is | |
| **not built**. | |
| - **The desktop app bundles the client**, so a server can't push new code to | |
| it. The app itself is installed from a source checkout. There are no signed | |
| releases yet. | |
| - **Metadata logging** can be added to the server or in front of it, and | |
| cannot be seen from the outside. | |
| The only technical protection is that the operator has less to log: no | |
| passwords, no message text, no IP addresses on Tor. | |
| ## Things we have not solved | |
| These are gaps in the prototype. Some are bugs, some are limits of the | |
| design. They are listed so that nobody has to find them. | |
| 1. **The server learns who talks to whom, and when.** Every event names the | |
| sender, the room and the time. Room membership is readable by the | |
| server, and by the other servers in the room. Padding hides message | |
| sizes within a bucket, and batching and random heartbeats blur timing, but | |
| a server sees the pattern of activity. End-to-end encryption does not | |
| hide this. | |
| 2. **Active membership outlives the 21 days.** Current `join`, `invite` and | |
| `ban` state stays while the room has active members. Expired `leave` events | |
| and empty rooms are now purged after retention, so departed users no longer | |
| leave a permanent trail. | |
| 3. **Accounts have no expiry.** Nothing deletes an inactive account. Users and | |
| operators can delete one, and doing so still leaves a deleted-user record | |
| (to reserve the name) and the account's `leave` events until they expire. | |
| 4. **Tokens: purged at start and every minute.** While the server runs, | |
| expired tokens and the device keys only they kept alive are purged every | |
| minute, followed by a SQLite WAL truncation checkpoint. At start-up, rows | |
| for tokens that expired while it was stopped are deleted and so are the | |
| keys of devices left with no live token (each module's `restore`, called from `server/index.js`). | |
| Until the next start or minute, an expired row is still on disk. | |
| 5. **Plain labels on sealed rows.** Events, media and queues are sealed, but | |
| the room ID, event ID, depth, day, queue owner and media ID sit beside | |
| the sealed data. A disk alone shows how active each room was on each day, | |
| and which devices had undelivered messages. Sealing the labels would | |
| mean the server could not look rows up. | |
| 6. **Plain records are not covered by crypto-shredding.** Accounts, OPAQUE | |
| records, token hashes, public keys, and the identity blob live until the | |
| operator deletes them. They are in every backup forever. | |
| 7. **Federation replicas.** An event for a room with members on two servers | |
| is stored on both. Each server enforces the 21 days with its own software. | |
| Taper can't make another server delete anything. A modified server can | |
| keep events forever. What it keeps, though, is the sender, room, time and | |
| ciphertext. It does not have the room keys. | |
| 8. **Remote joins and events are verified.** Both `verifyRemoteEvent` and | |
| `remoteJoin` verify `t.room.create` room ID hashes, Ed25519 signatures, | |
| Room v13 authorization rules and timestamps (`<= now + 5m`, and our own | |
| clock for our join event), covered by `server/test-state-res.js`. | |
| 9. **Backups made by the operator.** Taper can't see or prevent them. A | |
| backup that includes the key directory defeats retention. A backup of | |
| the data alone keeps all plain records forever. Snapshots can keep deleted | |
| key files. | |
| 10. **Deleted-row remnants.** The database is in WAL mode with `secure_delete` | |
| on and runs `PRAGMA wal_checkpoint(TRUNCATE)` after shredding, account | |
| deletion, device revocation and token purges. Underlying flash/SSD wear | |
| levelling can still retain overwritten blocks. | |
| 11. **A weak password undoes the separation of the two directories.** See | |
| [Password guessing](#password-guessing). | |
| 12. **The operator's own tools.** A reverse proxy, a CDN, monitoring, a web | |
| host's flow logs, or the system journal can record IP addresses and | |
| timing. Taper doesn't control them. | |
| 13. **The web client comes from the server.** See above. | |
| 14. **Memory.** Keys and decrypted state are in process memory. There is no | |
| memory locking, and swap is not addressed. | |
| 15. **No hardware-protected keys on the server.** The specification says daily | |
| keys and the OPAQUE secret should be held in a hardware security module | |
| or a key service. They are files on disk. | |
| 16. **Counters of inactive accounts.** The in-memory counters for an account in | |
| a raised scraping tier are kept until that account's next request. They | |
| hold counts only, and vanish at restart. | |
| 17. **Client-side retention.** The client now tracks when each inbound Megolm | |
| session was first seen (persisted sealed for kept devices), refuses to | |
| decrypt or back up sessions older than 21 days + 1 day margin, and prunes | |
| expired replay/session records. (The underlying Rust crypto store still | |
| holds the encrypted IndexedDB rows until the device is wiped.) | |
| 18. **Operators can clear a user's security keys** (`admin.js unlock`). That | |
| is by design, for someone who lost every key, but it means a security key | |
| protects against a stolen password or session, not against an operator | |
| who can be talked into it. | |
| ## Questions for a lawyer | |
| 1. What does "handing over" mean for data the operator holds but cannot | |
| read: the sealed event rows, the identity blob, the key backup? Are those | |
| "content", "metadata", or something else in each jurisdiction? | |
| 2. Can an operator be ordered to produce data they have *already destroyed* | |
| as designed (an expired daily key)? To stop destroying keys? To keep logs | |
| they never kept? What if the order arrives while the key still exists? | |
| 3. Can an operator be ordered to change the software they run, for example | |
| to serve a modified client to one user? Is a "technical assistance" or | |
| similar duty relevant? | |
| 4. Is a user's *membership in a room* treated as content or as | |
| non-content records? Does it matter that Taper keeps it longer than | |
| messages? | |
| 5. Does a hosting provider's duty differ from the operator's? What can | |
| they be ordered to give about an onion service on their machine? | |
| 6. Does federation make an operator responsible for what another server | |
| holds? Is an order served on one server reachable on a peer in another | |
| country? | |
| 7. What does a person owe if they are ordered to give up a password or a | |
| device passphrase, and does Taper's use of OPAQUE, which makes the | |
| operator unable to, change that? | |
| 8. Do the retention period and the deletion described here meet or conflict | |
| with any record-keeping duty an operator in a given country has? | |
| ## See also | |
| - [Dead man's switch](dead-mans-switch.md): destroying everything a server holds, on command or automatically. | |
| - [Threat model](threat-model.md) | |
| - [Compromised keys](design/compromised-keys.md) | |
| - [Running a Taper server](../deploy/README.md) | |
| - [Signed releases](design/signed-releases.md) | |
| - [Cryptography and Transport](../content/security.md), in particular | |
| "Encryption at rest" and "Identity recovery" | |
| - [Server README](../server/README.md) | |