Repository navigation
fix(sev-snp-qvl): bind the VCEK to the report chip and TCB - #1620
Merged
Merged
Conversation
Signed-off-by: Kevin Wang <wy721@qq.com>
Signed-off-by: Kevin Wang <wy721@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When SEV-SNP evidence carries its own
cert_chain,QuoteVerifierchecks the ARK → ASK → VCEK chain and the report signature, but never checks that the VCEK belongs to the chip and TCB the report claims.sev6.0.0 only verifies the ECDSA signature. The KDS path is bound implicitly, because the VCEK URL is built from the report'schip_idandreported_tcb. The supplied-cert path has no equivalent check.With a VCEK key from one chip, or one from an old TCB, an attacker can sign a report that claims any
chip_idand a newerreported_tcb. KMS usessha256(chip_id)as thedevice_id, so this defeats the device allowlist, and it lets the report claim a TCB the key was never issued for. The existing mock test shows the gap: the mock VCEK carries no AMD extensions at all, yet verification succeeds.Fix
After the report signature check, on both paths, require:
1.3.6.1.4.1.3704.1.4) to equalCHIP_ID. On Turin, where KDS keys VCEKs by the first 8 bytes, only those 8 bytes are compared. Both the raw and the DER OCTET STRING encodings are accepted.REPORTED_TCB.This follows Trustee's
verify_report_tcb, with one difference: the check always applies, rather than being keyed on the certificate CN, because VLEK is already rejected. A missing, duplicated or malformed extension is rejected.The mock VCEK now carries matching extensions. Its test also covers reports that are validly re-signed by the same VCEK but carry a different
chip_idorreported_tcb.Verification
dstack-attest/tests/sev_snp_verify.rs) still verifies under the new check.cargo test -p sev-snp-qvl -p mock-attestation -p dstack-tee-simulator -p dstack-attest -p dstack-verifierpasses.snpguest.Reported by @adeavid.