fix: mcp-server baseURL precedence and blocked-method regex case - #86
Open
BhariGowda wants to merge 1 commit into
Open
BhariGowda wants to merge 1 commit into
BhariGowda wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two independently verified correctness bugs in the hand-written MCP server code. Neither has an attack path security findings are being handled separately via responsible disclosure.
1.
??/?:operator precedence discards explicitCOINGECKO_BASE_URL(remote-sandbox-handler.ts:46)Due to
??binding tighter than?:in JavaScript, the expression:parses as
(readEnv('COINGECKO_BASE_URL') ?? environment) ? undefined : (client.baseURL ?? undefined).When
COINGECKO_BASE_URLis explicitly set andCOINGECKO_ENVIRONMENTis not, the configured value is silently discarded andundefinedis sent to the remote sandbox instead. Since the sandbox is a separate process with no other way to learn this value, a user's custom base URL (e.g. a self-hosted mirror or staging server) is genuinely lost.Verified: before fix returns
undefined, after returns the configured URL.Fix: add parentheses to express the intended logic.
2. Default
codeBlockedMethodsregexes are snake_case but method names are camelCase (options.ts:50)The default block list uses
coins\.circulating_supply_chart\..*andcoins\.total_supply_chart\..*, but actual fully-qualified method names are camelCase (coins.circulatingSupplyChart.get, etc.). Verified against the real 87-method list: both patterns match 0 methods. The advertised default block on circulating/total-supply-chart endpoints is silently a no-op.Fix: update defaults to match actual camelCase method names.
Testing: Root
yarn test217 passed, 160 skipped (live-API tests requiring keys), 0 failed. mcp-serverjest2 passed, 0 failed. Exactly 2 files changed, no generated or security-related files touched.Note: a third fix (invalid JSON in publish-npm.yml manual dispatch workflow) requires
workflowscope and will be filed separately.