Case · DiggingBeagle record

Gemini CLI reused a stored MCP OAuth token after its server URL changed

The reporter captured two local token-bearing POST requests reaching a replacement host.

Published by DiggingBeagle:

Scope

An MCP connection already authorized under one name, with later configuration or workspace influence over that name's URL.

Assessment profile

Assessment method
Setting
research demonstration
Exploitation
demonstrated
Evidence
Grade B
AI role
AGAINST AI
Basis and provenance

The cited primary source supports the stated mechanism and scoped outcome. Impact band remains unrated because no calibrated victim exposure or severity distribution is established by the cited evidence.

Assessed Nov 22, 2026 using diggingbeagle.assessment/1.

At a glance

Mechanism and trust boundary

  1. 01

    Authorize an MCP server under a local name

    A user completes OAuth and Gemini CLI stores bearer material for the configured server label.

    Boundary: Credential scoped to original MCP service identity

  2. 02

    Retarget that label

    Configuration or workspace control changes the server URL while preserving the old name used for token lookup.

    Boundary: Mutable server alias replaces authenticated resource origin

  3. 03

    Send credential to replacement host

    The CLI attaches the saved bearer token to requests to the new URL; the reporter captured two such POSTs in a local reproduction.

    Boundary: MCP OAuth credential disclosure across origins

Claims & evidence

CLM-2026-NOV22-GEMINI-CLI-MCP-TOKEN-SCOPEThe reporter captured two local token-bearing POST requests reaching a replacement host. This demonstrates the destination-binding issue in the tested CLI state, but not a known production credential theft campaign. At the time reported, the related fix was still under discussion.supported

Basis: reported finding

Link to claim
CLM-2026-NOV22-GEMINI-CLI-MCP-TOKEN-MECHANISMGemini CLI remembered OAuth credentials under an MCP server name. When a configuration change moved that named server to a different URL, the client reused the token and attached it to requests toward the new host without requiring new origin consent.supported

Basis: reported finding

Link to claim

Implications

Credential cache keys based only on a friendly server name are unsafe when that name can be repointed. The security decision should bind the token to its original canonical issuer and destination and require renewed consent for a changed endpoint; two local POSTs establish a test case, not a measured victim population.

Controls and mitigations

  • bind saved tokens to canonical resource origin and require reauthorization whenever that origin changes

Unknowns and contradictions

  • Exposure depends on who can change MCP configuration and whether subsequent operations send the token; a fix cannot be claimed shipped without a merged release.

Sources and citation

Material revision history

  1. Nov 22, 2026 · Published version · first publication · revision 275