I audited my own encrypted app and found the server could quietly strip the post-quantum half
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
X25519prekey - a last-resort
ML-KEM-1024key - 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.
Comments
No comments yet. Start the discussion.