The vulnerability lies in the dcap-qvl library's failure to properly verify the Quoting Enclave (QE) Identity, which is a critical component in the remote attestation process. The root cause is twofold: the library skipped the cryptographic signature verification of the QE Identity against its certificate chain, and it failed to enforce policy constraints on the QE Report, such as checking if the QE was in debug mode.
This allowed an attacker to forge a QE Identity and use it to sign untrusted quotes, which the verifier would then accept as legitimate. This effectively bypasses the security guarantees of SGX/TDX remote attestation.
The analysis of the patch commits reveals that the fix involves multiple changes. In the main Rust library, the verify_qe_identity_policy function was updated to validate the QE report's attributes, specifically to prevent the use of a debug-mode QE. The underlying cryptographic library for signature verification was also switched from ring to rustcrypto, indicating a fix in the verify_qe_identity_signature function. The main verify_impl function, which orchestrates the entire process, was therefore vulnerable due to these missing checks.
Similar fixes were applied to the JavaScript implementation, where verifyQeIdentityPolicy was updated to validate the QE report and verifyCertificateChain was hardened to prevent the misuse of CA certificates.