Skip to content

Commit 1bc01e8

Browse files
fix: upgrade @modelcontextprotocol/sdk to 1.29.0 to fix CVE-2026-4926 (#95)
Upgrades @modelcontextprotocol/sdk from ^1.27.1 to ^1.29.0, which resolves path-to-regexp to 8.4.1 and fixes the ReDoS vulnerability GHSA-j3q9-mxjg-w52f (CVE-2026-4926). Regenerates the patch for SDK 1.29.0 (replaces patch for 1.27.1) to maintain the warn-instead-of-throw behavior for output schema validation. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f08978d commit 1bc01e8

3 files changed

Lines changed: 29 additions & 11 deletions

File tree

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"dependencies": {
5252
"@mcp-ui/server": "^6.1.0",
5353
"@modelcontextprotocol/ext-apps": "^1.1.1",
54-
"@modelcontextprotocol/sdk": "^1.27.1",
54+
"@modelcontextprotocol/sdk": "^1.29.0",
5555
"@opentelemetry/api": "^1.9.0",
5656
"@opentelemetry/auto-instrumentations-node": "^0.56.0",
5757
"@opentelemetry/exporter-trace-otlp-http": "^0.56.0",

patches/@modelcontextprotocol+sdk+1.27.1.patch renamed to patches/@modelcontextprotocol+sdk+1.29.0.patch

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1-
diff --git a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
2-
index 23639ce..7b8a325 100644
1+
--- a/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js
2+
+++ b/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js
3+
@@ -197,7 +197,7 @@
4+
return;
5+
}
6+
if (!result.structuredContent) {
7+
- throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Output validation error: Tool ${toolName} has an output schema but no structured content was provided`);
8+
+ console.warn(`[MCP SDK Patch] Output validation warning: Tool ${toolName} has an output schema but no structured content was provided`);
9+
}
10+
// if the tool has an output schema, validate structured content
11+
const outputObj = (0, zod_compat_js_1.normalizeObjectSchema)(tool.outputSchema);
12+
@@ -205,7 +205,7 @@
13+
if (!parseResult.success) {
14+
const error = 'error' in parseResult ? parseResult.error : 'Unknown error';
15+
const errorMessage = (0, zod_compat_js_1.getParseErrorMessage)(error);
16+
- throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Output validation error: Invalid structured content for tool ${toolName}: ${errorMessage}`);
17+
+ console.warn(`[MCP SDK Patch] Output validation warning: Invalid structured content for tool ${toolName}: ${errorMessage}`);
18+
}
19+
}
20+
/**
321
--- a/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
422
+++ b/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
5-
@@ -194,15 +194,20 @@ export class McpServer {
23+
@@ -194,15 +194,20 @@
624
return;
725
}
826
if (!result.structuredContent) {

0 commit comments

Comments
 (0)