security: remove the legacy OAuth client-id fallback (it reads the merged git config) #712
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
sixfold-space/madtea#712
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
ReadOAuthClientID(internal/config/backend.go:60) reads the host-keyed client id from--global(:62), then falls back to the pre-host-keyed bare key at:67:runGit("config", "--get", oauthClientIDLegacyGitKey)whereoauthClientIDLegacyGitKey = "madtea.oauth-client-id"(:51). The fallback omits--global, so it reads the merged view, which includes a repo's--localconfig. Amadtea.oauth-client-idplanted in a repo's local git config would then steer the OAuth authorize URL's application id. The reader is called by the MCP login tool (internal/mcp/tools_auth.go:876).Decision
Remove the legacy fallback for v0.20.0, which drops pre-host-keyed legacy OAuth key support.
ReadOAuthClientIDresolves only the host-keyed--globalkey. This closes the finding at its root rather than narrowing the scope.Scope
It steers only which OAuth application id the authorize URL names; it captures no token (the OAuth core is PKCE S256, loopback redirect, no client secret). It is not clone-transferrable -
git clonedoes not copy the source repo's local config.Fix
Delete the
:67fallback block and the now-unusedoauthClientIDLegacyGitKeyconst. A missing id still surfaces as("", false). The CLI's own reader (setup.defaultReadOAuthClientID) is a separate path and is out of scope here.Breaking
A pre-host-keyed install that logs in through the MCP tool - and never ran the CLI setup, which migrates the key - must re-register its OAuth application. The release notes record the dropped key.
Acceptance criteria
ReadOAuthClientIDreads only the host-keyed--globalkey; the legacy bare-key fallback is gone.madtea.oauth-client-idis not read.hexajon referenced this issue2026-10-05 12:34:16 +00:00