← Lab /Security & privacy

KMS-Enclave integration remains vulnerable to passive data-swap

Using attestation-based KMS policies together with enclave-initiated TLS can fully prevent both passive and active attacks on the enclave-KMS communication channel

Security & privacy Trail of Bits 5 Aug 2026 Explainer Theory

Published as “A few notes on AWS Nitro Enclaves: KMS integration”

Why it matters

Developers cannot rely on KMS integration alone for enclave security; they must enforce strict key policies, use encryption contexts, and employ enclave-initiated TLS to mitigate identified attack surfaces.

Summary

The authors enumerate passive and active attack classes against the communication between AWS Nitro Enclaves and KMS, showing how attackers can swap encrypted data-key blobs, replay attestation documents, or modify CMK identifiers. They recommend mitigations such as hard-coding full CMK ARNs, using encryption contexts, enforcing enclave-initiated TLS, and tightening KMS key policies. The evidence is based on protocol analysis and design considerations rather than empirical testing, and they acknowledge residual risks like lack of end-to-end TLS and insider threats.

What they found 2

  1. Passive attackers can swap encrypted data-key ciphertexts stored outside the enclave

    “A single CMK key can be used to generate multiple data keys and shared secrets. Since the encrypted data keys are stored outside of the enclave, an attacker can swap them.”

  2. Active attacks require enclave-initiated TLS to be prevented

    “Active attacks are prevented with enclave-initiated TLS.”

Caveats 4

  • KMS terminates TLS outside of HSM (most likely), and the attestation’s pubkey encryption is probably done outside of HSM. This makes it impossible to have an end-to-end TLS channel between enclave and HSM, and AWS insiders may theoretically constitute an active attacker threat.
  • The enclave-initiated TLS solution to be secure, the enclave’s CA set must be limited; ideally, the KMS’ CA certificate (Amazon’s) is attested and pinned.
  • Locking access by PCR0 and denying all kms:PutKeyPolicy operations makes the system quite immutable. This has the obvious downside of making updates and bug fixes difficult.
  • Avoid the aws-nitro-enclaves-sdk-c: this particular SDK is written in C, and we found it contains vulnerabilities that can be used to exploit enclaves from the parent host.

What’s new here 4

  • Catalog of passive and active attack vectors specific to enclave-KMS interactions
  • Checklist of policy and TLS configurations to mitigate those attacks
  • Discussion of immutable key-policy design and its operational trade-offs
  • Recommendation to avoid the C SDK due to discovered vulnerabilities