Repository navigation
[v2] @modelcontextprotocol/server inlines fast-uri 3.1.0, which has 9 published advisories #2966
Description
Activity
- addedv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixesIdeas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
on Oct 7, 2026 - added 3 commits that reference this issue
on Oct 7, 2026 Confirmed on current main:
pnpm auditreports 9 fast-uri advisories, andpackages/server/tsdown.config.ts:33listsajv/ajv-formats/core-internalasnoExternal, so the transitivefast-uri@3.1.0frompnpm-lock.yaml:5058is baked intodist/ajvProvider-*.mjs. I built@modelcontextprotocol/serverfrom main and the dist still shows#region ...fast-uri@3.1.0. A consumer override can't touch a bundled devDependency. I checked the fix locally: forcingfast-urito3.1.8drops audit findings to 0, rebuilds the dist withfast-uri@3.1.8, andserver/core-internaltests still pass (576 + 1525). A release just needs the lockfile override + rebuild.I'd like to take this one. Verification on current
main(b022522):pnpm-lock.yaml:5058resolvesfast-uri@3.1.0;ajv@8.18.0declaresfast-uri: ^3.0.1, so the pinned resolution is what lands in the bundle.packages/client/tsdown.config.tsandpackages/server/tsdown.config.tsboth listajv/ajv-formatsinnoExternal, so the transitivefast-uriis inlined intodist/. Neither package declares it independencies, so consumeroverrides/resolutionsand lockfile scanners cannot reach the bundled copy.fast-uri@3.1.8(published 2026-09-15, past the 7-dayminimumReleaseAgecooldown) fixes all nine advisories, and itsURIComponentinterface is field-for-field identical to 3.1.0's, so the dts shim inpackages/core-internal/src/validators/fastUriShim.d.tsneeds no change.
Proposed fix — the minimal one, per the security-vulnerability trigger in
DEPENDENCY_POLICY.mdand the "small changes" principle inCLAUDE.md: pinfast-urito3.1.8in the rootresolutions(the mechanism already used forstrip-ansi), regenerate the lockfile, and ship a patch release ofclientandserverwith the rebuilt dist. The published dependency manifests stay unchanged, so this is a patch, not a major.I'm deliberately not unbundling ajv into a declared dependency in this PR —
DEPENDENCY_POLICY.mdcalls adding a runtime dependency a significant change that needs discussion first. Happy to do that as a follow-up if you'd prefer that direction, and happy to adjust if you want a different approach. Will open the PR shortly.Reacted by iroha924That matches what I found. With fast-uri pinned to 3.1.8 the advisory count for the ajv/fast-uri family drops to 0, and the client and server suites both pass against the rebuilt bundle (576 and 1525 tests). The one thing worth asserting in the PR is that the rebuilt dist actually inlines 3.1.8 — since fast-uri never reaches the published manifest, a lockfile-level check won't see which copy shipped either way. The resolutions route mirrors the strip-ansi pin, so it stays the minimal change.
- added a commit that references this issue
on Oct 10, 2026
What happened?
@modelcontextprotocol/server2.2.0, 2.3.0, and 2.3.1 inline ajv 8.18.0 and fast-uri 3.1.0 intodist/instead of declaring them as dependencies (theirdependenciesare onlyzodand@modelcontextprotocol/core; fast-uri is indist/ajvProvider-*.mjs, under//#region ../../node_modules/.pnpm/fast-uri@3.1.0/...).pnpm-lock.yamlonmainstill resolvesfast-uri@3.1.0.fast-uri 3.1.0 is affected by these advisories, all fixed in 3.1.8. All 9 are already public, and #2036 asks for the same kind of bump in v1:
GHSA-4c8g-83qw-93j6, GHSA-7p8r-x3mc-p8w7, GHSA-f65p-4m7j-42xc, GHSA-hrr3-gc8f-f4qj, GHSA-jqff-g426-hqxp, GHSA-q3j6-qgpj-74h6, GHSA-qw65-cvwx-89v3, GHSA-v2hh-gcrm-f6hx, GHSA-v39h-62p7-jpjc.
Because the code is inlined, a consumer cannot raise it with
overridesorresolutions, and the inlined versions do not appear in the consumer's lockfile, so tools that read the lockfile cannot report them. In our case, moving from@modelcontextprotocol/sdk1.x (whoseajvresolved to fast-uri 3.1.8 in our lockfile) to v2 would ship an older fast-uri than before, so we are holding the migration.We have not checked whether any of these advisories is reachable through the SDK's use of ajv.
What did you expect?
dist/(in the README or package metadata), so consumers can keep their SBOMs and third-party notices accurate.Code to reproduce
SDK version
@modelcontextprotocol/server 2.2.0, 2.3.0, 2.3.1
Area
Server