You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Self-hosted url in .sentryclirc is refused with its own token #2537
When a project's .sentryclirc has both an sntrys_ org token in [auth] token and a matching self-hosted [defaults] url, every command refuses to run: "Refusing to route requests here because it doesn't match the host your Sentry credentials are for." This is the setup sentry wizard writes for self-hosted projects (#2525, #2529).
assertRcUrlTrusted (packages/cli/src/lib/sentryclirc.ts) trusts a non-SaaS rc URL only when it matches getActiveTokenHost() or a stored login's host.
env-token-host.ts already treats an sntrys_ token's embedded url claim as authoritative, but it snapshots the host at boot, before applySentryCliRcEnvShim copies the rc token into SENTRY_AUTH_TOKEN. A token set later "was not scoped by this snapshot", so the rc token's claim is never consulted.
An env sntrys_ token plus a matching rc url already works.
Threat to keep covering: an attacker who can write or append to a .sentryclirc, or add a project-level one under a global rc that holds the token, but can't read the token. They must not be able to point an existing token at another host. SENTRY_CUSTOM_HEADERS also must not attach to hosts that only the rc shim names.
Scope chosen by @BYK: apply the claim check to rc-injected sntrys_ tokens only. Opaque tokens from .sentryclirc keep being refused for a self-hosted rc url.
Activity
linear-code commentedon Nov 26, 2026
MCP-1289
fix(cli): Trust a .sentryclirc url that matches its org token's claim (…