Repository navigation
Configfs path overridable via environment variable enables fake quotes #562
Description
The TDX quote generation code in dstack/dstack-util/src/tdx_attest.rs reads the configfs-tsm path from an environment variable without validation, allowing an attacker who controls the environment to redirect quote generation to an arbitrary path.
Root Cause
The TDX attestation library reads the DCAP_TDX_QUOTE_CONFIGFS_PATH environment variable to determine where to read/write TDX quote data. If set, this overrides the default configfs path (/sys/kernel/config/tsm/report). A process that can set this environment variable can redirect quote generation to an attacker-controlled filesystem path, serving fabricated TDX quotes.
// linux.rs:331-339
let configfs_path = std::env::var("DCAP_TDX_QUOTE_CONFIGFS_PATH")
.unwrap_or_else(|_| DEFAULT_CONFIGFS_PATH.to_string());Attack Path
- Attacker compromises a process inside the CVM or controls the process environment
- Attacker sets
DCAP_TDX_QUOTE_CONFIGFS_PATHto a directory they control (e.g.,/tmp/fake-tsm/) - Attacker populates the fake directory with crafted quote data
- When the application requests a TDX quote, it reads from the attacker's directory instead of the real configfs
- The fabricated quote may contain arbitrary report_data, measurements, or signatures
Impact
Applications using the tdx-attest library can be tricked into using fake TDX quotes. The impact depends on whether the quotes are verified downstream — if they are, the fake quotes will fail signature verification (they won't be signed by Intel's QE). However, in configurations where quote verification is disabled (a related finding, a related finding), fake quotes could be accepted.
Suggested Fix
Ignore the environment variable in production builds:
#[cfg(not(feature = "testing"))]
let configfs_path = DEFAULT_CONFIGFS_PATH.to_string();
#[cfg(feature = "testing")]
let configfs_path = std::env::var("DCAP_TDX_QUOTE_CONFIGFS_PATH")
.unwrap_or_else(|_| DEFAULT_CONFIGFS_PATH.to_string());Alternatively, validate that the configfs path points to a real sysfs mount.
Note: This issue was created automatically. The vulnerability report was generated by Claude and has not been verified by a human.
Activity
kvinwang commentedon Mar 25, 2026
Thanks a lot for the detailed report and for calling out this configuration option.
Our current threat model treats code running inside the CVM as potentially malicious as long as its behavior is fully covered by the TDX measurements and remote attestation. In other words, if an attacker can already run arbitrary code inside the guest and deliberately override the configfs path via an environment variable, we consider that a compromise of the CVM itself rather than a bypass of the attestation boundary. The verifier is expected to reason about the measured image / compose configuration, not to protect against arbitrary logic that the measured application chooses to execute on its own.
That said, the point that this knob can be used to redirect quotes is still very useful from a hardening and “foot-gun” perspective. We will review how this environment variable is used in practice (for example, restricting it to test/debug scenarios or guarding it behind explicit build-time flags) and update our documentation so it is clear that it is not intended for production use.
Thanks again for raising this and for the broader set of reports — they are very helpful for tightening the design and documentation of our threat model.
h4x3rotab commentedon Jun 30, 2026
Maintainer triage update: this 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: not a production vulnerability. A process that can choose its own quote path is already inside the measured CVM behavior. No code fix is planned for this report under the documented production threat model.
Closing as not planned.