Skip to content

Security: KMS get_temp_ca_cert returns temp CA private key without authentication #619

Closed

Description

@kvinwang

Note: This issue documents a vulnerability that was originally reported privately as the repository security advisory GHSA-jqq8-f829-47qf by @pbeza.

Root Cause

The get_temp_ca_cert endpoint returns temp_ca_key (a temporary CA private key) to any caller without requiring mTLS, attestation, or any form of authentication. This endpoint is designed for bootstrapping — new CVMs need to obtain a temporary CA key to create their initial RA-TLS certificates before they can establish mTLS. However, the endpoint is available to any network-reachable caller.

Attack Path

  1. Attacker discovers the KMS network endpoint (e.g., via F12011's unmeasured kms_urls)
  2. Attacker calls get_temp_ca_cert — no authentication required
  3. KMS returns the temp CA private key
  4. Attacker creates a valid RA-TLS client certificate signed by the temp CA
  5. Attacker uses the forged certificate to call authenticated KMS endpoints (e.g., get_app_key, sign_cert)
  6. Combined with F12003: if quote_enabled=false, attacker can also obtain root keys

Impact

Any network-reachable attacker can forge RA-TLS client certificates, impersonating any CVM to the KMS. This bypasses the mTLS authentication boundary. The blast radius depends on what additional checks KMS performs on authenticated requests (attestation verification), but combined with F12003, it provides full root secret extraction.

Suggested Fix

Restrict get_temp_ca_cert access through network-level controls (e.g., only accessible from the host's internal bridge network). Alternatively, implement a challenge-response mechanism where the CVM must prove it's running in a TDX environment before receiving the temp CA key. Consider using a short-lived, single-use token generated by the VMM for each new CVM.


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-jqq8-f829-47qf):

    This appears to be a duplicate of GHSA-gf25-vghj-6wh5. Please see our response there.

  2. added
    securitySecurity-related issue, report, or hardening work
    security: reportPublic security report or already-public security finding
    security: duplicateDuplicate security report or duplicate of private advisory response
    duplicateThis issue or pull request already exists
    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

    duplicateThis issue or pull request already existssecuritySecurity-related issue, report, or hardening worksecurity: duplicateDuplicate security report or duplicate of private advisory responsesecurity: 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