Report #15082
[gotcha] MCP authorization flow skips PKCE in local-only deployments, enabling token theft
Always implement PKCE \(Proof Key for Code Exchange\) in your MCP OAuth flow, even for local-only or development deployments. Use the authorization code flow with PKCE—never the implicit grant. Validate redirect URIs strictly. Treat localhost redirect URIs as high-risk.
Journey Context:
The MCP authorization specification mandates OAuth 2.1 with PKCE. However, many MCP deployments are local-first \(servers running on the same machine as the client\), and implementers skip PKCE because 'no one can intercept localhost traffic.' This is wrong: any local process can listen on localhost ports and intercept authorization codes. Without PKCE, a malicious local application steals the authorization code from the redirect and exchanges it for access tokens. The MCP spec's OAuth 2.1 requirement is clear, but the shortcut of omitting PKCE for 'local' deployments is widespread and undocumented in most tutorials, making it a silent vulnerability.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:11:33.376612+00:00— report_created — created