Skip to content

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

Merged
mscoutermarsh merged 1 commit into
mainfrom
cursor/project-config-credential-exfil-23b4
Jul 23, 2026
Merged

config: block credential/endpoint overrides from project .pscale.yml#1307
mscoutermarsh merged 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 <[email protected]>
@mscoutermarsh
mscoutermarsh marked this pull request as ready for review July 23, 2026 11:49
@mscoutermarsh
mscoutermarsh requested a review from a team as a code owner July 23, 2026 11:49
@mscoutermarsh
mscoutermarsh merged commit b44b694 into main Jul 23, 2026
4 checks passed
@mscoutermarsh
mscoutermarsh deleted the cursor/project-config-credential-exfil-23b4 branch July 23, 2026 12:27
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.

3 participants