Skip to content

OA1. Callback accepts the first request, whatever its state #2847

Closed

Description

@CloneOfAlex

Which version line?

v2 — current (@modelcontextprotocol/inspector@latest)

Which client?

All / shared core

Inspector version

2.13.0 (v2/main @ d7f6cee, built from source)

Node version

v22.23.4

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).

Activity

  1. cliffhall commented on Oct 29, 2026

    @cliffhall
    Member

    Triage: Priority Medium (total 6)

    • 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).

  2. added this to the v2.14.0 milestone on Oct 29, 2026
  3. self-assigned this
    on Oct 29, 2026
  4. cliffhall commented on Oct 29, 2026

    @cliffhall
    Member

    Fixed by #2854, merged into v2/main; verified together with the rest of v2.14.0 in the rollup #2858.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingv2Issues and PRs for v2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions