Conversation
kvinwang
force-pushed
the
fix/kms-sign-cert-verified-app-info
branch
2 times, most recently
from
October 3, 2026 02:15
891b798 to
88485ce
Compare
kvinwang
force-pushed
the
fix/kms-sign-cert-verified-app-info
branch
from
October 3, 2026 02:27
a24ab30 to
3c87784
Compare
Signed-off-by: Kevin Wang <wy721@qq.com>
Signed-off-by: Kevin Wang <wy721@qq.com>
This branch has not been deployed
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
A reader could find the VM config in more than one place, and different readers picked different copies:
vm_configalongside an attestation that also carries one. Readers took the request copy whenever it was non-empty and never compared it with the attested one.dstack-attestanddstack-mralso accepted a sys-config-shaped config, with the real config serialized under avm_configkey. The SEV-SNP parser indstack-mrpreferred the top-level fields, while the decoder indstack-attestlet the nested string replace the whole config. No producer in this repo emits that shape: attestations and requests both carry the flatsys_config.vm_config.On SEV-SNP the second split is exploitable. Suppose a
SignCertrequest carries the genuine top-levelos_image_hashplus a nested{"os_image_hash": <other>}. Authorization checks the genuine hash against the launch measurement, and the certificate's app-info extension then claims<other>.Fix
dstack_attest::resolve_vm_config(external, embedded): with one copy, use it; with two, require them to be identical.decode_vm_config, the SEV-SNP app-info decoder, the KMS SNP boot-info path and the verifier's launch binding all go through it.vm_configshape fromdstack-attestanddstack-mr, so a config has one layout and every field has one source. Inputs in the nested shape no longer parse.Honest requests are unaffected, because every in-tree caller fills both copies from the same
sys_config.vm_configstring.Verification
build_boot_info_for_attestationrejects a requestvm_configthat differs from the attested one and accepts an identical copy.cargo test --all-featurespasses for dstack-attest, dstack-mr, dstack-kms and dstack-verifier.cargo check --workspace --all-features --testspasses, and clippy (-D warnings) is clean on the touched crates.