CVE-2026-108716: mcp-remote Cleartext Credential Transmission via --device-code OAuth Grant
Critical OAuth bearer token leak in mcp-remote via unencrypted HTTP and world-readable cache, allowing full takeover of remote Model Context Protocol agent sessions.
HERMES AGENTIC SECURITY SCORE & MODEL CONTEXT PROTOCOL EVALUATION
Target:mcp-remote Proxy Client โ OAuth 2.0 Device Code Token Exchange Subsystem CVSS v3.1 rates this vulnerability at 9.4 (CRITICAL) due to the scope change (S:C) enabling cross-system compromise of remote Model Context Protocol (MCP) servers and LLM tool execution runtimes. The Hermes Agentic Security Score (HASS) elevates this evaluation to 93 (CRITICAL). In agentic workflows, MCP clients act as high-privilege proxies executing filesystem writes, shell commands, database queries, and cloud API interactions. Eavesdropping or extracting plaintext OAuth session tokens allows unprivileged adversaries to impersonate developer agents and invoke arbitrary tools on upstream MCP servers.
CVE-2026-108716: mcp-remote Cleartext Credential Transmission via --device-code OAuth GrantVULNERABILITY
Software platform affected by security vulnerabilities and agentic attack patterns.
๐ Why is this related? (Evidence & Provenance)
“Confirmed security vulnerability in mcp-remote Proxy Client documented in Hermes dossier.”
- [vulnerability_report]
- [government_confirmation]CISA verified active exploitation in the wild and mandated federal remediation deadline in KEV entry. — Source: Cybersecurity & Infrastructure Security Agency (CISA): CISA Adds CVE-2026-59822 to Known Exploited Vulnerabilities Catalog (Reliability: VERY_HIGH)
1. Technical Context & Affected Architecture Matrix
Section titled โ1. Technical Context & Affected Architecture MatrixโThe Model Context Protocol (MCP) standardizes how LLMs interface with external data sources, developer tools, and operational environments. mcp-remote acts as the secure tunnel client bridging local IDEs and agents with remote servers.
| Parameter | Technical Specification | Operational Details |
|---|---|---|
| CVE Identifier | CVE-2026-108716 | Canonical vulnerability tracking identifier |
| Affected Product | mcp-remote | Remote Model Context Protocol client proxy |
| Vulnerable Component | src/auth/device-flow.ts | OAuth 2.0 device flow polling and token cache engine |
| Impacted Versions | 0.8.0 through 0.14.3 | Developer workstations, CI/CD runners, and agent containers |
| Corrective Release | 0.14.4 | Enforced HTTPS, PKCE verification, and secure memory-only tokens |
| Vulnerability Class | Cleartext Transmission / Insecure Storage (CWE-319, CWE-732) | Unencrypted transport fallback and world-readable cache |
| Execution Context | Node.js / TypeScript / npm | Autonomous agent developer environments |
2. Root Cause Analysis & Flaw Decomposition
Section titled โ2. Root Cause Analysis & Flaw DecompositionโVulnerable Code Path: Insecure Transport Fallback & Unprotected Temporary Cache
Section titled โVulnerable Code Path: Insecure Transport Fallback & Unprotected Temporary CacheโDuring device authorization, mcp-remote queries the OAuth token endpoint in a polling loop until the user completes web authorization. In src/auth/device-flow.ts:
import * as fs from 'fs';import * as path from 'path';
export async function pollDeviceToken(deviceCode: string, tokenUrl: string) { // FLAW 1: Silently permits downgrade to plaintext HTTP if target port is non-standard const transportUrl = tokenUrl.replace(/^https:/, 'http:'); // Permissive HTTP fallback!
const response = await fetch(transportUrl, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: `grant_type=urn:ietf:params:oauth:grant-type:device_code&device_code=${deviceCode}` });
const tokenData = await response.json();
if (tokenData.access_token) { // FLAW 2: Saves token in shared /tmp with default umask (0644 - world readable!) const cachePath = path.join('/tmp', `mcp-session-${deviceCode.slice(0, 8)}.json`); fs.writeFileSync(cachePath, JSON.stringify(tokenData)); // Readable by any user on host return tokenData.access_token; }}Attack Flow & Tool Hijacking Diagram
Section titled โAttack Flow & Tool Hijacking DiagramโDeveloper / AI Agent Local OS / Shared /tmp Attacker / Local User Remote MCP Server+---------------------+ +--------------------+ +---------------------+ +-------------------+| Runs mcp-remote | | | | | | || --device-code | ----------> | Writes session | | Reads session file | | || | | /tmp/mcp-*.json | ----------> | Obtains access_token| | || Completes Auth | | (Permissions 0644) | | | | |+---------------------+ +--------------------+ +---------------------+ +-------------------+ | ^ | Direct MCP JSON-RPC Request | | with stolen Bearer token | +----------------------------------+ | {"method": "tools/call", | "name": "execute_bash", | "args": {"cmd": "id; uname -a"}}3. Attack Scenarios & Multi-Stage Execution Flow
Section titled โ3. Attack Scenarios & Multi-Stage Execution Flowโ- Device Flow Initiation:
A developer or automated CI workflow runs
mcp-remote --server https://mcp.enterprise.internal/sse --device-codeto authenticate an autonomous agent to enterprise tools. - Plaintext Eavesdropping or Local Cache Sniffing:
On a shared development server or multi-tenant Kubernetes pod node, an unprivileged attacker inspects
/tmpformcp-session-*.jsonfiles or sniffs the local loopback/egress segment for HTTP token responses. - Session Token Exfiltration:
The adversary extracts the OAuth access token (
ey...) and refresh token before the victim completes their task. - Autonomous MCP Tool Invocation:
The attacker directly establishes a WebSocket or SSE session to
https://mcp.enterprise.internal/sseusing the stolen credentials, executing arbitrary tools (tools/call) including shell execution and database mutations.
4. Forensic Triage & Multi-Platform Detection
Section titled โ4. Forensic Triage & Multi-Platform Detectionโtitle: Insecure mcp-remote Temporary Session Token File Accessid: d1789c02-4781-4328-9811-202610871601status: experimentaldescription: Detects unauthorized processes reading world-readable mcp-remote session token files in temporary directories.references: - https://vulncheck.com/advisories/mcp-remote-0.8.0-through-0.14.3-cleartext-credential-transmission-via-device-code-oauth-grantauthor: Hermes Codex CTI Teamdate: 2026/10/12logsource: category: file_access product: linuxdetection: selection_target: TargetFilename|startswith: '/tmp/mcp-session-' TargetFilename|endswith: '.json' filter_legit: Image|endswith: - '/node' - '/mcp-remote' condition: selection_target and not filter_legitfields: - ProcessId - Image - CommandLine - TargetFilenamelevel: hightags: - attack.credential_access - attack.t1552.001// Microsoft Sentinel / Defender for Endpoint// Detects unprivileged access to mcp-remote cache files in shared Linux directoriesDeviceFileEvents| where FolderPath == "/tmp"| where FileName startswith "mcp-session-" and FileName endswith ".json"| where ActionType in ("FileCreated", "FileModified", "FileAccessed")| project Timestamp, DeviceName, InitiatingProcessAccountName, InitiatingProcessFileName, InitiatingProcessCommandLine, FolderPath, FileName| order by Timestamp desc#!/usr/bin/env bash# Audit local /tmp for exposed mcp-remote session credentialsecho "[*] Scanning /tmp for world-readable mcp-remote token stores..."find /tmp -maxdepth 1 -name "mcp-session-*.json" -perm /o=r -exec ls -la {} + 2>/dev/null | while read -r line; do echo "[!] EXPOSED TOKEN FILE FOUND: $line"done5. Remediation Strategy & Mitigation Matrix
Section titled โ5. Remediation Strategy & Mitigation MatrixโUpstream Security Patch Application
Section titled โUpstream Security Patch ApplicationโUpgrade mcp-remote to version 0.14.4 or later:
npm install -g mcp-remote@latestVerification & Configuration Hardening
Section titled โVerification & Configuration HardeningโVerify that installed mcp-remote versions enforce TLS and secure storage:
mcp-remote --version# Expected output: >= 0.14.4In version 0.14.4, tokens are stored with strict 0600 file modes in $XDG_RUNTIME_DIR or memory buffers, and HTTP connections are strictly rejected.