Skip to content

config: block credential/endpoint overrides from project .pscale.yml#1307

Draft
mscoutermarsh wants to merge 1 commit into
mainfrom
cursor/project-config-credential-exfil-23b4
Draft

config: block credential/endpoint overrides from project .pscale.yml#1307
mscoutermarsh wants to merge 1 commit into
mainfrom
cursor/project-config-credential-exfil-23b4

Conversation

@mscoutermarsh

Copy link
Copy Markdown
Member

Summary

Project-scoped .pscale.yml (git root or cwd) was merged into viper with no key filter. A checked-in file could set api-url, api-token, or service-token / service-token-id, so pscale would send the user's keyring OAuth token to an attacker-controlled host.

Fix

  • Replace unconditional MergeInConfig for project files with MergeProjectConfig, which only merges org, database, and branch.
  • Ignore all other keys from directory-local config (including api-url and tokens).
  • Warn on stderr when non-allowlisted keys are present so victims notice a hostile or mistaken config.
  • User home config (~/.config/planetscale/pscale.yml), --config, flags, and env vars are unchanged.

Tests

  • Allowlist filter rejects api-url / token keys
  • Merge preserves a pre-set api-url and never imports project credentials
  • Missing project file is a no-op

go test ./internal/config/ passes.

Open in Web Open in Cursor 

Directory-local .pscale.yml was MergeInConfig'd with no key filter, so a
checked-in api-url (or service-token) could redirect authenticated API
calls and leak the user's keyring token. Only merge org/database/branch
from project/working-directory config; warn when other keys are ignored.

Co-authored-by: Mike Coutermarsh <coutermarsh.mike@gmail.com>
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.

2 participants