Resources

People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!

Not so Secure Enclaves- 1812

Joran HonigPosted 3 Months Ago
  • Some applications have very strong security requirements. For instance, you should be able to execute code but not know what's executing. In cases like Secret Network, these secure enclaves are really important for security. A server compromise does nothing in this case.
  • Secure enclaves run in a very locked down environment. On AWS Nitro, users can only interact with the enclave via a virtual socket. Each enclave contains an attestation document, such as the hash of the image running, the hash of the kernel and whether it's signed or not.
  • Evervault is a platform built on top of AWS Nitro enclaves. It's providing scaffolding and infrastructure that allows connecting over HTTPs to the connection. They do this by including the attestation document in the TLS handshake. The key used to establish the connection must match the one in the attestation document. Besides this, the application needs to check all PCR values.
  • The Golang library for doing PCR validation has a neat feature: it only compares the PCRs that you want. If you leave the PCR as an empty string, then it will be considered valid. This comes at a funny cost of complexity though: what if a malicious host returned an empty string? If the user expected a value to be here and the empty string was passed in, the remote PCR validation would pass! The public bug report is here.
  • The vulnerability really only affects applications that check PCR8. This is because anything with a valid AWS signature requires that PCR0-2 be present and the requirement that at least one PCR must be sent in the document. Overall, an interesting bug that was found from really understanding the threat model.