-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fweinberger/fix sensitive local storage #715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🎭 Playwright E2E Test Results✅ 24 passed Details24 tests across 3 suites 📊 View Detailed HTML Report (download artifacts) |
18c6450 to
b8f5d2c
Compare
b8f5d2c to
36b9acc
Compare
cliffhall
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
…lcontextprotocol#726) This commit resolves a regression introduced in PR modelcontextprotocol#715 where the OAuth flow always chose client_secret_post regardless of the server's token_endpoint_auth_methods_supported setting. ## Problem - PR modelcontextprotocol#715 removed client_secret from sessionStorage for security reasons - This broke the MCP SDK's ability to determine the correct authentication method - OAuth flows with servers requiring client_secret_basic would fail ## Solution - Added temporary in-memory storage for client_secret during OAuth flow - client_secret is stored temporarily when saveClientInformation() is called - client_secret is provided to the SDK when clientInformation() is called - client_secret is cleared from memory after successful token exchange or clear() - client_secret is never persisted to sessionStorage (maintains security) ## Testing - Added comprehensive tests for temporary client_secret handling - Verified client_secret is available during OAuth flow - Verified client_secret is not stored in sessionStorage - Verified client_secret is cleared after token exchange - All existing tests continue to pass 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Turns out we actually are. It is retrieved and sent to the |
Motivation and Context
CodeQL pointed out we were storing some OAuth information unencrypted in SessionStorage which is not ideal: https://github.com/modelcontextprotocol/inspector/security/code-scanning/8
Not all of this information is sensitive, but the
client_secretpotentially is. We're actually unnecessarily storing this, as it's not used at any point after storage - we're storing it by default right now becuThis PR filters out the
client_secretbefore storage of OAuth information to the sessionStorage for improved security.More details:
Details
From @claude:⏺ When client_secret Gets Supplied
Based on my investigation:
Conclusion
The client_secret:
The simplest fix is to filter it out when storing, since it's not needed after the initial OAuth flow completes.
How Has This Been Tested?
Ran inspector to do some smoke testing with local MCP servers, OAuth still worked, including on refresh.
Ran tests with
npm run testand these still passed.Breaking Changes
None.
Types of changes
Checklist
Additional context