fix: Resolve MCP SDK security vulnerability#13056
Merged
Conversation
DeJeune
approved these changes
Feb 26, 2026
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.
What this PR does
Before this PR:
@modelcontextprotocol/sdkversion that had security vulnerabilities (GHSA-8r9q-7v3j-jr4g).MCPService.ts, the code incorrectly accessedparams.messagefield which did not exist in the type definition. The old SDK usedlooseObjecttype, so no TypeScript error was raised.serialize.tsutility was only available in the renderer process and could not be used in the main process (Node.js).After this PR:
@modelcontextprotocol/sdkfrom an older version to1.27.1to resolve the security vulnerability.MCPService.tsby using thedatafield instead ofmessageto get the log message, following the official MCP specification: https://modelcontextprotocol.io/specification/2025-11-25/server/utilities/logging#log-message-notificationsserializeutility fromsrc/renderer/src/utils/topackages/shared/utils/so it can be used by both main and renderer processes.Refactoring:
packages/sharedpackage only contained a singleutils.tsfile.serialize.tsto the shared package, the existingutils.tswas migrated topackages/shared/utils/index.ts.serialize.tswas added topackages/shared/utils/serialize.ts.Fixes #
Why we need it and why it was done in this way
The following tradeoffs were made:
looseObject), which exposed the existing bug whereparams.messagewas incorrectly used. This is now fixed by using thedatafield as per the official spec.unknowntypedatafield to string, the serialize utility needed to be accessible from both main and renderer processes. The utility was moved to the shared package since its functions (using only standard JavaScript/TypeScript features likeJSON.stringify) are compatible with both Node.js and browser environments.The following alternatives were considered:
messagefield: Not viable as it doesn't exist in the new SDK types and the official spec recommends usingdatafield.Links to places where the discussion took place:
Breaking changes
datafield instead ofmessage. A small number of older MCP servers that use the non-standardmessagefield for log information will no longer be supported. However, this is the correct behavior according to the official MCP specification, so this change is considered a bug fix rather than a breaking change.Special notes for your reviewer
MCPService.tsusesasto bypass TypeScript type checking. After manual review, the types do not match correctly. AFIXMEcomment has been added to indicate this needs future attention, as the exact type mapping is still being determined.Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
Release note