The vulnerability lies in the improper validation of AWS Nitro Enclave attestation documents within the evervault-go SDK. The core of the issue was a flawed "naive equality check" in the attestation.PCRs.Equal function. This function would incorrectly approve an attestation document if some expected Platform Configuration Registers (PCRs) were missing from the document.
The mapAttestationPCRs function contributed to this by returning empty strings for any PCRs not present in the attestation document, without raising an error. The verifyPCRs function then used the flawed Equal method, which would skip checks for any expected PCRs that were empty, and would successfully compare the empty strings from mapAttestationPCRs for missing PCRs. This allowed a document missing critical PCRs (such as PCR8) to be considered valid.
Furthermore, the internal/attestation.Cache.LoadDoc function cached the raw attestation document without any pre-validation, meaning a single fetched invalid document could be used to bypass attestation repeatedly.
The patch rectifies these issues by:
- Replacing the vulnerable
Equal method with a new SatisfiedBy method that ensures a minimal set of required PCRs (0, 1, and 2) are present in the received document before comparison.
- Modifying
mapAttestationPCRs and adding validateAttestationDoc to explicitly check for the presence of required PCRs and return an error if they are missing, ensuring documents are validated before being cached and used.