Skip to content

Security: Host-supplied sys_config not measured but influences security-critical behavior #615

Closed

Description

@kvinwang

Note: This issue documents a vulnerability that was originally reported privately as the repository security advisory GHSA-m52x-2r7m-5p42 by @pbeza.

Root Cause

The CVM reads sys_config from the host at boot time. This configuration contains security-critical values that are NOT extended into any RTMR:

  • kms_urls: Which KMS instances the CVM contacts for key derivation
  • gateway_urls: Which gateway instances the CVM registers with
  • pccs_url: The Provisioning Certificate Caching Service URL used for DCAP quote verification
  • docker_registry: Docker registry mirror (see F12010)
  • host_api_url: The host API endpoint

None of these values are measured in RTMR3 or any other register. Remote attestation verifiers have no way to confirm that the CVM is communicating with the expected infrastructure.

Attack Path

  1. Malicious host operator sets pccs_url to an attacker-controlled PCCS
  2. CVM boots and uses the attacker's PCCS for DCAP quote verification during KMS key provisioning
  3. Attacker's PCCS returns manipulated collateral (e.g., stale TCB info) to make invalid quotes pass
  4. KMS accepts the manipulated quote and provisions keys to an unattested CVM
  5. Alternatively: attacker redirects kms_urls to a rogue KMS that logs all derived keys

Impact

Host operator can redirect the CVM's connections to attacker-controlled infrastructure without detection by remote attestation. This undermines the entire trust model — the CVM believes it's communicating with legitimate KMS/gateway/PCCS but is actually talking to attacker infrastructure.

Suggested Fix

Extend all security-critical sys_config values into RTMR3 as runtime events:

emit_runtime_event("kms-urls", serde_json::to_string(&sys_config.kms_urls)?.as_bytes())?;
emit_runtime_event("gateway-urls", serde_json::to_string(&sys_config.gateway_urls)?.as_bytes())?;
emit_runtime_event("pccs-url", sys_config.pccs_url.as_bytes())?;

MPC verifiers should then validate these events against expected values during attestation.


Note: This finding was reported automatically as part of an AI/Claude-driven internal audit by the NEAR One MPC team. It has not been manually verified by a human to confirm whether it constitutes an actual security issue.

Activity

  1. kvinwang commented on Mar 27, 2026

    @kvinwang
    CollaboratorAuthor

    Maintainer response (copied from private security advisory GHSA-m52x-2r7m-5p42):

    Thanks for the report, but this is not a security vulnerability.

    dstack does not rely on these URLs or their domains as trust anchors. Security is enforced at the protocol level through cryptographic verification, not by trusting network endpoints. Specifically:

    • KMS (kms_urls): Communication uses RA-TLS with mutual quote verification. Even if redirected to a rogue KMS, the RA-TLS handshake would fail because the rogue server cannot produce a valid TDX quote with the expected measurements. A rogue KMS cannot provision or intercept keys.

    • Gateway (gateway_urls): The gateway authenticates using TLS certificates issued by the KMS. A rogue gateway cannot present a valid KMS-signed certificate.

    • PCCS (pccs_url): The collateral returned by PCCS (TCB info, CRL, etc.) is signed by Intel. A malicious PCCS cannot forge Intel's signature. Stale or tampered collateral would fail signature verification.

    • Docker registry (docker_registry): As discussed in GHSA-wh3v-6w2w-vq9m, images are verified by SHA256 digest. A malicious registry cannot serve altered images.

    • Host API (host_api_url): Communication with the key provider uses mutual quote attestation and encrypted channels. A rogue endpoint cannot pass quote verification.

    Measuring these URLs in RTMR3 would add no security value — it would only reduce deployment flexibility by coupling attestation to specific infrastructure URLs. The correct trust model is to verify the identity of the remote party (via attestation and cryptographic signatures), not the address used to reach it.

  2. added
    securitySecurity-related issue, report, or hardening work
    security: reportPublic security report or already-public security finding
    security: not-production-vulnDoes not compromise supported production deployments under the documented threat model
    on Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    securitySecurity-related issue, report, or hardening worksecurity: not-production-vulnDoes not compromise supported production deployments under the documented threat modelsecurity: reportPublic security report or already-public security finding

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions