github / github/copilot-cli

Secure credential storage for HTTP MCP OAuth tokens

オープン
#2,783 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
area:authentication area:mcp
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

### Describe the feature or problem you'd like to solve

The Copilot CLI currently persists OAuth access and refresh tokens as plaintext JSON files on disk (~/.copilot/mcp-oauth-config/*.tokens.json) when authenticating to HTTP-based MCP servers. This introduces several security concerns:
1. **Plaintext exposure** - Tokens stored as unencrypted JSON can be read by any process or user with filesystem access. This violates the principle of least privilege for credential storage.
2. **Cloud sync risk** - Many enterprise users sync their home directory or profile folders via OneDrive, Dropbox, or similar tools. Plaintext tokens in synced directories get uploaded to cloud storage, expanding the attack surface and triggering DLP/security policy violations.
3. **Credential persistence** - File-based tokens survive beyond their intended session lifetime. If a machine is compromised, an attacker gains access to cached tokens without needing to re-authenticate.
4. **Inconsistency with VS Code** - VS Code already handles MCP OAuth tokens securely through the OS Secret Storage API (Windows Credential Manager, macOS Keychain, libsecret on Linux). The CLI should follow the same pattern for consistency and security.

### Proposed solution

Leverage the OS-native credential/secret manager on each platform rather than writing tokens to disk. This aligns with security best practices, avoids DLP policy conflicts, and provides a consistent security posture across the Copilot toolchain.

### Example prompts or workflows

_No response_

### Additional context

_No response_

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by locating the code that writes OAuth tokens to ~/.copilot/mcp-oauth-config/*.tokens.json. Review how the CLI authenticates to HTTP-based MCP servers and how VS Code uses OS Secret Storage, including Windows Credential Manager, macOS Keychain, and libsecret on Linux. Done means tokens no longer persist as plaintext files and are stored through native credential managers on each platform.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
shell
領域
authentication, cli, security
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。