Skip to content

fix(sev-snp-qvl): bind the VCEK to the report chip and TCB - #1620

Merged
kvinwang merged 2 commits into
nextfrom
fix/snp-vcek-binding
Nov 19, 2026
Merged

kvinwang merged 2 commits into
nextfrom
fix/snp-vcek-binding

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

Problem

When SEV-SNP evidence carries its own cert_chain, QuoteVerifier checks the ARK → ASK → VCEK chain and the report signature, but never checks that the VCEK belongs to the chip and TCB the report claims. sev 6.0.0 only verifies the ECDSA signature. The KDS path is bound implicitly, because the VCEK URL is built from the report's chip_id and reported_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_id and a newer reported_tcb. KMS uses sha256(chip_id) as the device_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:

  • the hwID extension (1.3.6.1.4.1.3704.1.4) to equal CHIP_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.
  • the blSPL/teeSPL/snpSPL/ucodeSPL extensions (plus fmcSPL on Turin) to equal 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_id or reported_tcb.

Verification

  • The real Milan fixture (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-verifier passes.
  • With the new call removed, the new negative cases fail: the forged reports are accepted.
  • No real Turin VCEK is available, so the 8-byte hwID rule follows the KDS URL format and snpguest.

Reported by @adeavid.

Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang merged commit a87e030 into next Nov 19, 2026
23 checks passed
@kvinwang
kvinwang deleted the fix/snp-vcek-binding branch November 19, 2026 04:45
@kvinwang
kvinwang restored the fix/snp-vcek-binding branch November 19, 2026 04:46
@kvinwang
kvinwang deleted the fix/snp-vcek-binding branch November 19, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant