Skip to content

fix(gateway): redact cf_api_token in ListDnsCredentials response#578

Merged
kvinwang merged 1 commit intomasterfrom
fix/redact-dns-credential-token
Mar 19, 2026
Merged

fix(gateway): redact cf_api_token in ListDnsCredentials response#578
kvinwang merged 1 commit intomasterfrom
fix/redact-dns-credential-token

Conversation

@kvinwang
Copy link
Collaborator

Summary

  • Redact cf_api_token in ListDnsCredentials API response to prevent credential leakage
  • Tokens are displayed as pSFc...lQs (first 4 + last 4 chars), tokens <= 8 chars are fully masked

Found during gateway cluster deployment — ListDnsCredentials was syncing and exposing the full Cloudflare API token in plaintext.

Test plan

  • cargo check -p dstack-gateway passes

The ListDnsCredentials API was returning the full Cloudflare API token
in plaintext. Redact it to show only the first and last 4 characters
(e.g., "pSFc...lQs") to prevent credential leakage via the admin API.
@kvinwang kvinwang merged commit 2f96c95 into master Mar 19, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant