Fix vulnerable MCP SDK dependency#102
Conversation
| app.use(express.json({limit: '20mb'})); | ||
|
|
||
| const httpTransport = new StreamableHTTPServerTransport({ | ||
| sessionIdGenerator: undefined, |
There was a problem hiding this comment.
Removing this will turn this into a stateful server, which I don't think we want to do
There was a problem hiding this comment.
Thanks for catching this.
I amended the branch to restore the explicit stateless setting with sessionIdGenerator: undefined. The remaining cast is limited to the options object because SDK 1.29 rejects that explicit undefined under exactOptionalPropertyTypes.
|
FYI: https://overreacted.io/npm-audit-broken-by-design/ I'm unsure if we're actually vulnerable here, and I've been burned many times updating the SDK so am kinda spooked by this |
|
Fair point. npm audit alone would be a bad reason to take this. In this case the package is the direct runtime MCP SDK this server imports for stdio/HTTP, not a random nested dependency. The diff only bumps I reran GitHub CI (current and lts both pass), plus local If you would rather do the SDK bump yourself, no problem. Close this and treat the diff/test list as a reference. |
e587c92 to
46ab6dc
Compare
|
This PR keeps the server on |
|
tldr: I'm going to close this for now: it introduces a failure mode that breaks the HTTP server, and doesn't actually fix any security issues. I took a deeper look at what was being changed by this PR. The two SDK advisories don't actually apply to this server:
Additionally, this PR as written would have broken the server in HTTP mode. SDK 1.26+ adds a runtime guard that throws unconditionally on the second The ajv and path-to-regexp findings also don't apply here — no Also because 1.29.0 has an upstream typing bug it needs |
|
Well, thank you anyways for reviewing this PR, I see now why it doesn’t really fit the project, sorry if I wasted your time. |
Summary
@modelcontextprotocol/sdkto the patched 1.29.x linepackage-lock.jsonso the production dependency graph resolves to patched SDK transitivesexactOptionalPropertyTypesVerification
npm audit --omit=dev --jsonreports 0 production vulnerabilitiesnpm ci --ignore-scriptsnpm run buildnpm test(52 passed, 6 skipped)This addresses the public MCP TypeScript SDK advisories reported by npm audit, including the URI template ReDoS and cross-client data leak findings.