ZEKORO / questions and answers zekoro.one Answers to the questions and points from the latest outside security review. Background detail is in structure.txt, what was changed is in changes.txt. ──────────────────────────────────────────────────────────────────────── Q: How is the recovery code wrapped? Same PBKDF2 as the password? ──────────────────────────────────────────────────────────────────────── Yes, same construction, different input: PBKDF2(code, random 16-byte salt, 210,000 iterations, SHA-256) -> AES-256-GCM over your private key The code is 16 characters from a 32-symbol alphabet (no I, O, 0 or 1), generated in your browser from a cryptographic random source. That is 80 bits of real randomness. A human password might have 30 or 40 bits, which is why passwords need heavy stretching. 80 random bits cannot be brute-forced whether you do 1 round or a million, so we left the recovery wrap at 210k rather than invalidate everyone's saved codes. The code never leaves your browser; the server only holds the wrapped blob, its salt and nonce. ──────────────────────────────────────────────────────────────────────── Q: When someone is removed from a server, can they decrypt new messages? ──────────────────────────────────────────────────────────────────────── No. There is no shared group key that would need rotating. Every channel message is encrypted individually to each current member's public key, and the member list is fetched fresh from the server on every send. Once you're removed, new messages simply aren't encrypted to you, and the server also refuses your requests to read the channel. What they keep: anything they already received. Those were encrypted to their key and may be on their device. No messenger can take back a message someone already has. The one caveat is that the server decides who is on the member list. A malicious server could add a hidden member. That member would show up in the member list, so it wouldn't be invisible, but it is a trust point, same as the key directory (see next answer). ──────────────────────────────────────────────────────────────────────── Point: no way to verify keys (MITM, reset hijack via @fede) ──────────────────────────────────────────────────────────────────────── Fixed. Added: - safety numbers: 60 digits per pair, same on both screens, compare out of band, mark verified - key pinning: your device remembers each person's key and shows a loud warning if it changes - DMs and calls pause on a changed key until you accept it The reset-hijack case: for accounts with no email, reset codes go to @fede. Whoever gets a code can take the account, but they get a new key (no recovery code, no old key), so they can't read history, and every contact sees "key changed" before sending them anything. Adding a verified email takes @fede out of the loop for your account. ──────────────────────────────────────────────────────────────────────── Point: PBKDF2 at 210k SHA-256 is below current guidance ──────────────────────────────────────────────────────────────────────── Fixed. Now 600,000 rounds (OWASP's number for PBKDF2-SHA-256). Existing key blobs are re-wrapped at 600k automatically the next time you type your password; no action needed. We went up the rounds route rather than switch to SHA-512 because it keeps one code path and 600k SHA-256 is the recommended setting on its own. While in there we found a bigger issue the review didn't list: login sent the raw password to the server, and that same password unwraps your key. Now the browser sends a separately derived auth key instead, and the password never leaves your device. Old accounts are moved over on next login. ──────────────────────────────────────────────────────────────────────── Point: no forward secrecy ──────────────────────────────────────────────────────────────────────── Correct, and not fixed yet. Messages use long-term static keys. If a private key is stolen, all past and future messages to and from that person can be decrypted. This is now spelled out in the SHARP EDGES section of structure.txt instead of left for people to discover. Real forward secrecy needs a ratchet protocol and a rethink of multi-device history, which is a big piece of work we'd rather do properly than rush. ──────────────────────────────────────────────────────────────────────── Point: Cloudflare terminates TLS and serves the JS ──────────────────────────────────────────────────────────────────────── Correct, now documented under SHARP EDGES. Two separate things: 1. Cloudflare decrypts HTTPS at its edge. It sees what our server sees: metadata and ciphertext. Message content is still end-to-end encrypted inside that and Cloudflare can't read it. 2. The code that does the encryption is downloaded from us (via Cloudflare) every visit. Whoever controls either could serve a modified app.js that leaks your password or key. Safety numbers don't protect against this. Every browser-based encrypted messenger has this property; the honest thing is to say so. ──────────────────────────────────────────────────────────────────────── Extra: something else we fixed while looking ──────────────────────────────────────────────────────────────────────── Call setup (the SDP carrying the DTLS fingerprints) went through the server in plaintext, so the server could have put itself in the middle of a call. It is now sealed to the other person's pinned key, and anything unsealed or tampered is refused. ════════════════════════════════════════════════════════════════════════ SECOND REVIEW ════════════════════════════════════════════════════════════════════════ ──────────────────────────────────────────────────────────────────────── Point: put /db on its own subdomain ──────────────────────────────────────────────────────────────────────── Done. It's db.zekoro.one now, its own origin with its own session cookie, serving only the viewer, its sign-in and its data API. zekoro.one/db redirects there and the data API no longer exists on zekoro.one at all. ──────────────────────────────────────────────────────────────────────── Point: channels still encrypt to changed keys ──────────────────────────────────────────────────────────────────────── Fixed. A member whose key changed since your device pinned it is left out of your channel messages until you accept the new key, the same way DMs pause. You get a one-time notice saying so. ──────────────────────────────────────────────────────────────────────── Point: bind context inside the ciphertext ──────────────────────────────────────────────────────────────────────── Done. Every message is sealed with where it belongs (the DM pair or server + channel + sender, by permanent account number), a random message id and the send time. Readers reject a wrong location and a repeated id, and flag a send time more than 10 minutes off. The server assigns its own row id after encryption, so the client-made random id is what's checked for duplicates. Old messages without the envelope are still shown; new ones without it are refused. ──────────────────────────────────────────────────────────────────────── Point: safety numbers need an immutable id ──────────────────────────────────────────────────────────────────────── They already use one: the permanent numeric account id, never the username. Renaming doesn't change your safety number. Pins are keyed the same way. ──────────────────────────────────────────────────────────────────────── Point: the iOS app could fix the served-code problem ──────────────────────────────────────────────────────────────────────── Agreed that it would, and the groundwork exists (a bundler that produces a self-contained, hash-pinned copy of the client, plus the app-side loader). It isn't shipped: we've stopped making iOS builds. For now the served-code edge stays as described in structure.txt. ──────────────────────────────────────────────────────────────────────── Point: relay-only calls ──────────────────────────────────────────────────────────────────────── Done: Settings, "Hide my IP address in calls". Your device only offers relay addresses and skips Google's STUN server entirely. Testing it turned up that the relay had never been reachable (its hostname pointed at Cloudflare, which can't carry TURN), so calls only worked when a direct path existed. That's fixed too. ════════════════════════════════════════════════════════════════════════ THIRD REVIEW ════════════════════════════════════════════════════════════════════════ ──────────────────────────────────────────────────────────────────────── Point: turn.zekoro.one exposes the server's real IP ──────────────────────────────────────────────────────────────────────── True, and it was already public before that (other names on the same server are DNS-only). So instead of hiding the address, the site now refuses anything that doesn't come from Cloudflare: zekoro.one and db.zekoro.one only accept connections from Cloudflare's published IP ranges (refreshed weekly), and a direct connection gets a 403. That also means the client-IP header our rate limits read can't be spoofed anymore. Moving the relay to a separate machine would be the next step, and it's a cost decision we haven't made. ──────────────────────────────────────────────────────────────────────── Point: lock down coturn ──────────────────────────────────────────────────────────────────────── Done. Denied as relay targets: 0/8, 10/8, 100.64/10, 127/8, 169.254/16, 172.16/12, 192.0.0/24, 192.168/16, 198.18/15, 240/4, ::1, ::/112 and ::ffff:0:0/96, 64:ff9b::/96, fc00::/7, fe80::/10, and the server's own IPv6. Its own IPv4 stays allowed so two relayed users can reach each other, but a firewall rule drops relayed traffic to any local port outside the relay range (tested: packets aimed at a local service were dropped, and 169.254.169.254 got "403 Forbidden IP"). TCP relaying is off. Credentials were already short-lived: use-auth-secret, 12 hours, per account. Logging is off. ──────────────────────────────────────────────────────────────────────── Point: desktop apps ──────────────────────────────────────────────────────────────────────── They're Tauri, not Electron. There's no Node in the page, and the only capability granted is Tauri's core default set, which remote pages (zekoro.one) don't get. An XSS or a tampered app.js stays inside the web view; it can't reach the file system or run programs. It is the same served-code situation as the website, as structure.txt says. ──────────────────────────────────────────────────────────────────────── Point: envelope downgrade ──────────────────────────────────────────────────────────────────────── Fixed as suggested. Each device remembers, per chat, the first message id it saw with an envelope and refuses any envelope-less message after it, whatever timestamp the server gives it. Every envelope-less message that is shown is marked "unverified". What's left: on a device that has never opened a chat, the server could insert an old-format message among the old history. It would show as unverified. Written up under sharp edges. ──────────────────────────────────────────────────────────────────────── Point: synced passkeys ──────────────────────────────────────────────────────────────────────── Added to sharp edges: a synced passkey that can unlock messages is exactly as strong as the Apple, Google or password-manager account it syncs through. Settings already tags synced passkeys. ──────────────────────────────────────────────────────────────────────── Point: GDPR basics on the privacy page ──────────────────────────────────────────────────────────────────────── Added: who runs it and a contact address outside the app (privacy@zekoro.one), the legal basis (contract and legitimate interest), your rights with how to use each, the Garante as the authority to complain to, where data lives (netcup, Nuremberg, Germany) and who processes it (Cloudflare, Brevo, Google STUN), and a retention table. The relay no longer logs, so its retention is "none". Access and deletion are now self-service: Settings > Your data has "Download my data" and "Delete my account". ──────────────────────────────────────────────────────────────────────── Point: docs contradicting each other ──────────────────────────────────────────────────────────────────────── Fixed. features.txt no longer lists the iPhone app as a current app or its native call screen; it points iPhone users to Safari or the home screen and says the old app isn't updated.