-
Notifications
You must be signed in to change notification settings - Fork 74
Description
The attestation verification in dstack/kms/src/main_service.rs treats an all-zero mr_config_id in the quote as a wildcard, skipping the config identity check. An attacker who can produce a quote with a zeroed mr_config_id would bypass this verification.
Root Cause
When mr_config_id is all zeros, two things happen:
-
The config ID verifier skips verification entirely (
config_id_verifier.rs:40-42): ifmr_config_id == [0u8; 48], verification returnsOk(())without checking any configuration. -
The
mr_aggregatedcomputation excludesmr_config_idwhen it's zero (attestation.rs:407-428): different configurations produce the samemr_aggregatedhash because the config measurement is omitted rather than included as zeros.
Attack Path
- Host operator launches a CVM without setting
mr_config_id(defaults to all zeros) - Config ID verification is skipped — no configuration integrity check occurs
- The
mr_aggregatedidentity hash does not include any configuration measurement - A CVM with malicious configuration produces the same
mr_aggregatedas one with legitimate configuration - Remote verifiers checking
mr_aggregatedcannot distinguish between the two
Impact
Configuration integrity verification can be trivially bypassed by not setting mr_config_id. The mr_aggregated identity becomes weaker because it doesn't include configuration state. Different CVM configurations appear identical to remote verifiers.
Suggested Fix
- Treat zero
mr_config_idas a verification failure rather than a skip condition - Always include
mr_config_idinmr_aggregatedcomputation, even when zero:
// Always include in aggregated hash
hasher.update(&mr_config_id);
// Reject zero config_id in production
if mr_config_id == [0u8; 48] {
return Err(Error::MissingConfigId);
}Note: This issue was created automatically. The vulnerability report was generated by Claude and has not been verified by a human.