TEE KMS critique: upgradeable contracts can hand over keys, 18 days of plaintext prompts
zoan37 · x · 2026-11-23
zoan37 challenges claims that Phala's team cannot decrypt user data, citing Gemini Neon's code-level analysis of the open-source DstackKms.sol:
- DstackKms is a UUPS-upgradeable contract where addKmsAggregatedMrAtEpochs, addOsImageHashAtEpochs, and authorizeUpgrade are onlyOwner-gated. Whoever controls the KMS owner/auth backend can authorize a modified KMS binary or OS image (or upgrade the auth contract), making a live KMS hand over root/app keys—no TEE exploit needed. On-chain deployment is publicly auditable; a hosted KMS has no chain trail at all.
- Via OpenRouter, users don't perform client-verified remote attestation + E2EE directly to an enclave key—which is why an unhardened GPU node served plaintext DeepSeek prompts for 18 days without clients or OpenRouter noticing.