Revert "fix: filter out client_secret when storing OAuth client information" #827
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reverts commit 36b9acc which filtered out
client_secretfrom being populated in local browser storage in response to a CodeQL advisory.Situation
In OAuth there is a notion of a “client id” and a “client secret”, and also a “public” client and a “confidential” client:
Additionally, there are access tokens and refresh tokens:
In Inspector:
Complication
A recent Github CodeQL rule indicated that our plaintext storage in localStorage was insecure. It looked like client_secret was unused, so we removed it from local storage here. This broke people who were relying on client_secret from their servers.
The attack vector we’re concerned about is an XSS attack or malicious chrome extension could read the local storage, and use it to gain access to an MCP server and abuse a user’s data. This is applicable to the following tokens:
This is not particularly concerning for:
Question
What is the right set of tradeoffs for storing tokens in MCP Inspector that balances developer convenience with risk of abuse from attackers?
Options
sessionStoragefor all tokensOptions (1) or (4) seem most viable.
(2) adds a hurdle, but not fundamentally more secure (XSS could also decrypt the tokens)
(3) requires the server to set the cookies anyway, so is mostly just a more complicated version of (4).
Given the current issue folks are blocked on is client_secret not being available, and adding it back doesn’t materially change our security posture (since access_tokens are still there in plaintext), I’m proposing with this PR that we go with (1) (i.e. back to the way things were) and then work towards (4).
Appendix
PR addressing CodeQL concern re: plaintext storage: #715
Discord thread from Cliff discussing issue in general:
https://discord.com/channels/1358869848138059966/1419078117590564904/1420187984438890548
Cliff’s PR implementing encryption in local storage, w/ key available via /config endpoint #822
Issue where users noticed the regression from not supporting
client_secretany more:#726
How Has This Been Tested?
Tested with the example given in #726
Breaking Changes
Types of changes
Checklist