I've been building Umbera for a while: messaging and calls without a phone number, with hybrid X25519 + ML-KEM encryption. I've written about the hybrid before. Under one of my posts someone pointed out, fairly, that security claims you can't check aren't worth much. So this time I didn't ship features. I went through my own code the way an outside auditor would, someone paid to find the hole.
I found more than I wanted to. Nothing leaked, and everything below is fixed and tested, shipping in the next app update. A couple of these stung, though.
The post-quantum key nobody checked
This is the worst one. Every message is sealed with two keys at once, classical X25519 and post-quantum ML-KEM-1024. The whole point of a hybrid is that you have to break both.
The app pins a contact's keys on first contact, and if they change later you get a warning, like in Signal. Turns out only the classical keys were pinned. The contact's ML-KEM key was taken from the server fresh every time.
So the server, or whoever owns it, could swap in its own ML-KEM key. It still couldn't read anything, because the classical half stayed honest. But the post-quantum half became decoration, and "record now, decrypt later" made sense again. That's exactly the attack the hybrid exists to stop.
Now ML-KEM and ML-DSA keys are pinned with the rest, and the key transparency log checks ML-KEM too. A swap looks like any other key change, and you see the warning.
Starting a conversation the way Signal does
The second issue follows from the first. Our Double Ratchet session used to start from the contact's long-term key. After that, keys changed with every message and a fresh ML-KEM secret got mixed in now and then, so the ongoing chat was fine. The very first messages, though, rested on a long-lived key. Steal it a year later and you can open the start of the conversation.
Signal fixed this in 2023 with PQXDH, and I followed the same design. Each device uploads a prekey bundle ahead of time: a signed X25519 prekey, a last-resort ML-KEM-1024 key, and 32 one-time keys of each kind. The bundle is signed with both account keys, secp256k1 and ML-DSA-65, and the app only uses it if both signatures match the pinned keys. The first root key comes from three or four X25519 exchanges plus the ML-KEM secret. Each one-time key is used once and deleted only after the message is safely stored.
The bundle is fetched anonymously, without logging in, the same way directory keys are. I spent some time making sure the server doesn't learn who's talking to whom from those fetches.
Then I ran the code through a separate clean-slate review that didn't look at my notes, and it found three medium issues. The most real-world one: if the connection dropped right while the bundle was uploading, the server kept keys the phone no longer had. For a week, every new chat with that person quietly started the old way. On a train that happens all the time. One-time keys could also be drained anonymously in about an hour. All fixed before release.
Older app versions keep working. If the other side doesn't speak the new protocol, the chat starts the old way, and nobody is forced to update just to keep talking.
Calls with Tor on were going around Tor
The app has Tor built in. Messages went through it properly, but call audio and video went straight to the relay server from your real IP. Someone turns on Tor, makes a call and thinks they're hidden. That's worse than having no Tor at all.
Pushing live audio through Tor isn't trivial, the latency is noticeable. Here's how it works now. While Tor is on, the app keeps a Tor path to the relay warm in the background. If it works, the call goes only through it. If Tor can't carry it right now, the call takes the usual path and shows a banner saying the relay can see your IP. If that's not acceptable to you, there's a "Calls only through Tor" switch, and without Tor the call simply won't start and the app tells you why.
Desktop updates
The desktop app updates itself. On Windows and Linux the download was checked against a hash that came from our own server. Compromise the server, swap the file and the hash, and everyone gets malware. macOS had Apple's signature, the other platforms had nothing.
Every release is now signed with two keys, Ed25519 and ML-DSA-65. The app installs an update only if both check out, and the signing keys don't live on the server at all.
What the server learned from wake-ups
Less flashy, but I think it matters. To wake your phone when a message arrives, the app registers its mailbox addresses with the server. It used to send them all in one request: the account mailbox plus one per conversation. That told the server all those mailboxes belonged to one person, and with timing it could rebuild who talks to whom. The mailbox design exists precisely so it can't. Now each mailbox registers separately with its own tag, and the server has nothing to join them on.
The silent first call
One story that isn't about security, just because it ate a lot of my time. Call an iPhone from Android after the iPhone has been locked for a while. It rings, they answer, the timer runs, and neither side hears anything. The second call works fine.
I blamed the keys, Android's sleep, the network. Sixteen runs on the simulator, all perfect. The simulator just can't reproduce it: it doesn't get VoIP pushes, and the bug only happened when a push woke the iPhone and you answered from the lock screen. At that moment the app confirmed the answer to the system before switching audio into call mode. A freshly woken app was still in the default mode, so the call was silent. By the second call the right mode was already set from the first one. One line in the wrong place.
What's not done
So this doesn't read like everything is perfect now. Conversations that started before the update don't move to the new start on their own, only new ones do. If a malicious server refuses to hand out a bundle, the app starts the old way and restarts the session with the new one later. There's no strict "don't send without the new protocol" mode yet. And I ran this audit myself with my own tools. No outside firm has looked at it yet.
The crypto core is open, with the protocol description and tests you can run yourself. If something here looks off, tell me. I'd rather hear it from you.
Top comments (7)
Pinning only the classical half is the kind of hole a happy-path test never finds, because the chat still works and the server still cannot read the X25519 side. If the hybrid is meant to stop a record-now-decrypt-later swap, the ML-KEM key has to be pinned and checked the same way as the classical one.
Yep, that's exactly it. It's fixed now and the update with the fix goes out soon.
What changed: the app now pins the other person's ML-KEM key (and their ML-DSA signing key) the first time it sees them, same way X25519 was already pinned. If the server later hands over a different key, it doesn't get swapped in quietly anymore. It goes into a pending slot, the contact gets marked "key changed" and sending is blocked until you check it or accept it, same flow as for the classical keys.
On top of that the ML-KEM key the server serves is checked against the key transparency log, so it can't show you one key and put another one in the log. Keys saved by the old version just get pinned on update, nothing to redo.
Ran it against older app versions too, no false "key changed" warnings. Thanks for actually reading it, most people stop at "it still works" :)
Parking the new key in a pending slot and blocking sends is the right default, since a silent swap was the whole hole. Checking the served post quantum key against the transparency log also kills the split view trick. One question: if only the post quantum key changes while X25519 stays the same, does the contact get the same key changed warning, or is that handled as a softer case?
Same warning, no softer case. A PQ-only change is still a key change: the new ML-KEM key sits in the pending slot, the contact gets the same "key changed" prompt, and sending stays blocked until you accept it.
Funny you ask though. I was checking exactly this path tonight and found that the classical check right after it could clear the flag again, because X25519 still matched. So the warning could pop up and then just disappear. Fixing it now, it goes into the same update. Thanks for pushing on this one.
A flag that one check sets and a later check clears is exactly the kind of bug that comes back after a refactor. I'd add a regression test that changes only the ML KEM key, runs the full verification path, and asserts the pending state is still there at the end. Making the key changed flag something only an explicit user accept can clear would also stop any future check from undoing it.
Good call, and you're right, this is exactly the kind of thing that breaks again in a refactor.
The test is already in. It changes only the ML-KEM key, runs the full path with the classical check passing both before and after, and checks the warning is still up at the end. Same test for ML-DSA.
On the flag you're half right. The classical check can still lower it, but only when no PQ key is pending. In the bug that part was simply missing. A PQ key that differs from the pin now only goes away when the user taps Accept. I kept one auto-clear case on purpose: the server goes back to serving the exact key we already have pinned. Otherwise a false alarm would hang there forever.
Making Accept the only way out is tempting though. I'll think about whether that one case is worth keeping. Thanks for reading it this closely.
Keeping the auto clear for the exact pinned key sounds fair to me, as long as the match covers both post quantum keys together. If the server brings back the old KEM key while the signing key still differs, that one case could clear a warning that should stay up. Is the comparison done per key or on the pair?