You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
simulate_quote patches report_data at hardcoded offset with no build-time guard #563
The quote simulation flag in dstack/dstack-util/src/tdx_attest.rs is controlled by a runtime environment variable rather than a compile-time feature gate, so a compromised process that sets this variable can cause the system to accept simulated (non-hardware) quotes.
Root Cause
The guest agent's simulate_quote functionality is controlled by a runtime config flag (simulator.enabled) rather than a compile-time feature gate. When enabled, the function patches report_data at a hardcoded offset within a pre-baked quote template, producing a quote that looks structurally valid but is not generated by TDX hardware.
// Controlled by runtime config, not #[cfg(feature = "simulator")]ifself.config.simulator.enabled{returnself.simulate_quote(report_data);}
Attack Path
A production deployment is accidentally configured with simulator.enabled = true
Guest agent serves simulated quotes instead of real TDX hardware quotes
Simulated quotes have fixed measurements, MRTD, and RTMRs from the template
If the KMS or verifier accepts these quotes (e.g., because they match expected measurements by coincidence, or if quote signature verification is also disabled), the system operates without real hardware attestation
The report_data is the only part that varies — everything else is static from the template
Impact
A misconfigured production deployment could serve simulated quotes that bypass TDX hardware attestation. The runtime flag makes this a configuration error away from total attestation bypass, whereas a compile-time gate would prevent simulation code from existing in production binaries.
The concern you raised has been addressed in PR #582 ("refactor(guest-agent): isolate simulator from production paths"): the quote simulator now lives in a dedicated dstack-guest-agent-simulator binary and is no longer switchable from the production guest-agent via a runtime flag.
In other words:
production builds only use the real TDX hardware attestation path;
simulator-only helpers and configuration are confined to the simulator crate/binary;
there is no mixed-mode behavior where a misconfigured runtime flag in a production deployment would silently route requests through the simulator.
Given this refactoring, the issue described here is now limited to the simulator environment and does not affect production deployments.
Activity
kvinwang commentedon Mar 25, 2026
Thanks again for reporting this.
The concern you raised has been addressed in PR #582 ("refactor(guest-agent): isolate simulator from production paths"): the quote simulator now lives in a dedicated
dstack-guest-agent-simulatorbinary and is no longer switchable from the production guest-agent via a runtime flag.In other words:
Given this refactoring, the issue described here is now limited to the simulator environment and does not affect production deployments.
h4x3rotab commentedon Jun 30, 2026
Maintainer triage update: this was fixed by #582 and is recorded in the public security report table: https://github.com/Dstack-TEE/dstack/blob/master/docs/security/public-security-reports.md#public-reports-and-findings
Disposition: valid report, fixed. #582 isolates the simulator into a dedicated binary.
Closing as fixed.