The classical threat model of cryptography assumes a clear boundary: secrets live inside a trusted computing base, and adversaries operate outside it. Hardware-assisted trusted execution environments — Intel SGX, ARM TrustZone, AMD SEV, and their kin — attempt to redraw that boundary at the silicon level, carving out enclaves whose contents remain opaque even to the operating system, hypervisor, and a physical adversary with bus probes.
The promise is seductive. If we can establish a small, hardware-enforced perimeter around sensitive computation, we can run cryptographic protocols, key management services, and confidential workloads on untrusted infrastructure with provable guarantees. Memory encryption keys never leave the CPU package. Attestation primitives let remote verifiers bind protocol transcripts to specific code measurements. The trusted computing base shrinks from millions of lines of kernel code to a few thousand lines of enclave logic.
But the gap between the formal abstraction and the deployed reality has proven uncomfortably wide. A decade of cryptanalytic and microarchitectural research has revealed that enclaves leak through channels the threat model never contemplated: cache timing, speculative execution, power analysis, even the rowhammer effect. Understanding TEEs requires holding two truths simultaneously — that they offer genuine, useful isolation, and that their security guarantees are conditional in ways most deployments fail to acknowledge.
TEE Threat Model Analysis
Every cryptographic primitive begins with an explicit adversary model, and TEEs are no exception. The canonical SGX model assumes an adversary who controls the operating system, hypervisor, BIOS, peripherals, and physical bus, but cannot compromise the CPU package itself. The trust anchor is a hardware-embedded root key, fused at manufacture, accessible only to microcode and the on-die memory encryption engine.
Within this model, SGX provides three properties: confidentiality of enclave memory through transparent encryption with integrity trees, integrity against replay and substitution via versioned MAC trees, and isolation from non-enclave code through hardware-enforced page access controls. TrustZone takes a coarser approach, partitioning the entire system into secure and non-secure worlds, while AMD SEV-SNP operates at VM granularity with attestation rooted in the AMD Secure Processor.
What the model explicitly excludes matters as much as what it includes. Denial-of-service is out of scope — the OS can always refuse to schedule an enclave. Availability of secrets is not guaranteed. And crucially, the model assumes architectural isolation, leaving microarchitectural state shared between enclave and adversary as an unaddressed concern.
The threat model also presupposes a trustworthy silicon vendor. Intel's compromise of the SGX attestation root keys would silently undermine every deployed enclave. This single point of trust collapses the otherwise decentralized cryptographic guarantees into something closer to a managed PKI — a fact rarely acknowledged in marketing materials but central to any rigorous security analysis.
For the cryptographic designer, the practical consequence is that enclaves are best understood as a conditional isolation primitive rather than an unconditional one. They strengthen the threat model against software adversaries dramatically, while introducing new dependencies on hardware vendor integrity and microarchitectural side-channel resistance that protocols must explicitly address.
TakeawayA threat model is a contract about what the adversary cannot do. Read what a TEE excludes from its guarantees as carefully as what it promises — the omissions are where deployments break.
Remote Attestation Protocols
Attestation is the cryptographic bridge between local hardware enforcement and remote trust. Without it, an enclave is merely an isolation mechanism; with it, a remote verifier can establish that a specific binary, with a specific configuration, is executing inside genuine hardware before exchanging secrets with it.
The protocol structure is broadly consistent across platforms. The enclave produces a quote: a signed structure binding a measurement of its code and data (typically a SHA-256 of initial pages) to a freshly generated public key or nonce supplied by the verifier. The signing key derives from a hardware-embedded secret, and the signature chains to a vendor-operated certificate authority — Intel's IAS originally, now DCAP with provisioning certificates, and equivalent infrastructures for AMD and ARM.
The cryptographic subtleties accumulate quickly. SGX's EPID scheme was designed for unlinkable group signatures, preserving platform anonymity across attestations — an elegant application of Boneh-Boyen-style constructions. DCAP abandoned this for ECDSA with explicit platform identifiers, trading anonymity for operational simplicity. The trade-off illustrates how attestation protocol design encodes deep assumptions about which adversaries we fear.
Verification is the underappreciated half of the protocol. A correct verifier must check the quote signature, validate the certificate chain to the vendor root, confirm the measurement matches an expected value, verify revocation status, and bind the attested public key to the subsequent session. Any of these steps performed incorrectly — and many real-world implementations have erred — reduces attestation to security theater.
More fundamentally, attestation proves what code started running, not what it is currently doing. An enclave compromised through a memory safety bug after attestation still presents a valid quote. This is why robust deployments combine attestation with formally verified or memory-safe enclave code, treating the attested measurement as a necessary but insufficient condition for trust.
TakeawayAttestation answers the question of what is running, not whether it is correct. A signature on a measurement of buggy code is still a signature on buggy code.
Side-Channel Attack Surface
If the threat model defines the theoretical perimeter of an enclave, microarchitectural side channels define its practical one. The CPU is a vast shared resource — caches, branch predictors, TLBs, store buffers, line-fill buffers, execution ports — and these structures retain state observable across the architectural isolation boundary that TEEs enforce.
Spectre and Meltdown made this visible to a broad audience, but the relevant research lineage extends back through cache-timing attacks on AES, Flush+Reload, Prime+Probe, and the entire ecology of contention-based observation. For SGX specifically, attacks like Foreshadow (L1TF) demonstrated that speculative execution could extract enclave memory and even the attestation sealing keys, undermining the cryptographic chain of trust at its root.
The defensive response has followed two tracks. Microcode mitigations from vendors patch specific leakage paths — clearing buffers on enclave entry, flushing predictors, disabling hyperthreading on enclave-active cores. Each mitigation imposes performance costs and addresses only known leakage vectors. The MDS, RIDL, and ZombieLoad families have repeatedly shown that the attack surface is broader than the patches.
The deeper response is constant-time programming inside enclaves: avoiding secret-dependent branches and memory accesses entirely. This discipline, long familiar to cryptographic implementers, must extend to all enclave code that touches sensitive data. Tools like ct-verif and constant-time analyzers help, but the requirement effectively means enclave authors must write code resistant to a more powerful adversary than the hardware model formally guarantees.
The honest conclusion is that current TEEs provide isolation against software adversaries who limit themselves to architectural channels, and best-effort resistance against microarchitectural adversaries. Treating them as cryptographic black boxes — assuming any computation inside is opaque — remains incorrect. The enclave is a leaky abstraction, and protocols building on it must account for that leakage explicitly.
TakeawayHardware isolation is a property of the architectural model. Real silicon has microarchitectural state, and that state speaks louder than the specification admits.
Secure enclaves represent one of the more ambitious attempts to extend cryptographic reasoning into the physical substrate of computation. They have genuinely shifted what is possible — confidential cloud computing, privacy-preserving analytics, and decentralized key management have all been built on TEE foundations with meaningful security improvements over the alternatives.
Yet the history of TEE deployment is also a sustained lesson in the gap between formal models and implemented systems. Each new attack class has required not patches to the protocols built on enclaves, but reconsideration of what those protocols were assuming. The mature design discipline that has emerged treats enclaves as a useful but bounded primitive, composed with constant-time implementations, defense-in-depth, and protocol-level resilience to enclave compromise.
The cryptographic principle worth retaining is that hardware roots of trust extend the reach of our protocols, but do not eliminate the need to reason carefully about what we are trusting and why. The most robust systems are those whose security degrades gracefully when the enclave assumption weakens — because eventually, in some new microarchitectural corner, it will.