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
OA1. Callback accepts the first request, whatever its state #2847
Operating system (and browser, for the web client)
Linux (Debian)
Transport
Streamable HTTP
MCP server under inspection
The repo's own OAuth test server: node test-servers/build/server-composable.js --config test-servers/configs/oauth-revocation-http.json (Streamable HTTP on :8083).
Steps to reproduce
OAuthCallbackServer sets handled = true on the first request to the callback path. An error response is not checked against state at all, and a success response is checked only later, inside the token exchange. Reproduced against the repo's OAuth test server: while the CLI waited on 127.0.0.1:6276, one request with ?error=access_denied&error_description=injected+by+another+process and no state ended the run with exit 1 and the message injected by another process. A genuine callback after that would get 409.
Expected behavior
Fix: ignore (with a short 400) any callback whose state does not match the flow in progress, error responses included, and keep listening until a matching one arrives or the timeout fires. Label server-supplied text in the error ("the authorization server said: …").
Actual behavior
The default port is fixed (6276), so any local process, or a web page that can make the browser request that URL, can cancel a sign-in and choose the text the CLI reports. PKCE still stops a forged code from being redeemed, so this is denial and message spoofing, not account takeover.
Logs, errors, or screenshots
No response
Already prototyped a fix?
No response
Before you submit
I searched existing issues and this is not a duplicate.
This is not a security vulnerability report (those go through the private advisory process).
Severity 3 — a local process or web page can cancel an in-progress CLI/TUI sign-in and choose the error text shown; PKCE still prevents token theft, so denial/spoofing only
Urgency 2 — wanted eventually, nothing blocked on it
Bonuses: +1 bug label (no milestone, assignee, epic, engagement or reporter-set priority)
Board: #28, Status Incoming (awaiting maintainer review — no milestone yet).
Activity
cliffhall commentedon Oct 29, 2026
Triage: Priority Medium (total 6)
buglabel (no milestone, assignee, epic, engagement or reporter-set priority)Board: #28, Status
Incoming(awaiting maintainer review — no milestone yet).fix(core): mark OAuth error source explicitly; wait on request arriva…
fix(core): race the OAuth state against stop once per start, not per …
cliffhall commentedon Oct 29, 2026
Fixed by #2854, merged into
v2/main; verified together with the rest of v2.14.0 in the rollup #2858.