Skip to content

get_app_env_encrypt_pub_key unauthenticated — app_id enumeration #564

@pbeza

Description

@pbeza

The /prpc/Kms.GetPublicKey endpoint in dstack/kms/src/main_service.rs returns the KMS root public key without requiring any authentication, allowing any network client to retrieve it.

Root Cause

The get_app_env_encrypt_pub_key endpoint returns app-specific encryption public keys without requiring any authentication (no mTLS, no admin token, no attestation). While the returned key is a public key (not a secret), the endpoint allows unauthenticated callers to enumerate valid app_id values by observing which requests return keys versus errors.

Attack Path

  1. Attacker discovers the KMS endpoint
  2. Attacker calls get_app_env_encrypt_pub_key with various app_id values
  3. Successful responses indicate valid app_ids; errors indicate invalid ones
  4. Attacker builds a list of all active applications registered with the KMS
  5. This information can be used to target specific applications in subsequent attacks

Impact

Information disclosure — an attacker can enumerate all registered application IDs. This is low severity because app_ids may not be secret, and the returned public keys are not sensitive. However, the enumeration provides reconnaissance value for targeted attacks against specific applications.

Suggested Fix

Require at minimum mTLS authentication for this endpoint, or return a consistent response (e.g., a dummy public key) for both valid and invalid app_ids to prevent enumeration.


Note: This issue was created automatically. The vulnerability report was generated by Claude and has not been verified by a human.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions