Repository navigation
fix(deps): apply security fixes at their first patched versions [SAP-4715] - #1277
antoine-berger wants to merge 9 commits into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
/devin review |
gwitwer
left a comment
There was a problem hiding this comment.
Please split this PR. Keep a security PR at the lowest patched versions (docs/security/dependency-fix-playbook.md in sapiom/Sapiom, Phase 2) and drop the maintenance upgrades. The harness is not a supported target right now, so harness-only upgrades are not wanted.
- Vite: drop Vite 8 and
@vitejs/plugin-react6. Raise harnessviteto^6.4.4, which closes alerts #440, #442, #443, #455 and #456. Vite 8 also changes the default browser build target, andpackages/harness/web/vite.config.tssets none. - Other drops: the ts-jest bump across 15 packages (no alert), and floors above the patched version: langsmith ^0.11.7 where 0.6.0 closes #137, hono ^4.13.16 where 4.13.11 is enough, and the MCP SDK ^1.32.2 where 1.32.0 is enough.
- Keep: the scoped overrides at their first patched versions, undici ^7.30.1, axios ^1.20.0, and the removal of the unused uuid dependency.
Track SAP-4715's "latest compatible" maintenance separately.
@sapiom/agent-map and @sapiom/harness declared uuid ^10.0.0 (and @types/uuid) but import it nowhere. Dropping the declarations closes Dependabot alerts #325 and #361 on their manifests without moving any resolved version: uuid 10 stays in the lockfile for the @langchain/* 0.3 dev graph, which the overrides commit handles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tched releases [SAP-4715] Add one pnpm override per vulnerable major line, each at the lowest release that closes every open Dependabot alert on that line: body-parser 1.20.9 and 2.4.0, brace-expansion 1.1.21, 2.1.7 and 5.0.12, browserslist 4.28.7, dompurify 3.4.17, fast-uri 3.1.9, handlebars 4.7.10, hono 4.13.11, ip-address 10.7.4, js-yaml 3.15.2 and 4.3.2, postcss 8.5.23, proxy-addr 2.0.8 and qs 6.16.1. fast-xml-parser 4, langsmith 0.3, uuid 9/10 and toml 4 have no patched release in their own major, so they move to 5.7.0, 0.6.0, 11.1.1 and 5.0.1. The first three sit only in @sapiom/langchain-classic's dev-only @langchain/* 0.3 test graph; toml sits under effect, which uses parse() only in its CLI module. baseline-browser-mapping, nanoid and source-map-js need no key of their own: the patched browserslist and postcss releases that resolve require baseline-browser-mapping ^2.11.33, nanoid ^3.3.20 and source-map-js ^1.2.2. The lockfile also gains the patched parents' own dependencies (fast-xml-parser 5's strnum 2 and XML helpers, body-parser 2.4's content-type 2.1 and iconv-lite 0.7.3, browserslist's data packages) and drops langsmith 0.3's console-table-printer, simple-wcswidth and @types/uuid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eases [SAP-4715] @sapiom/fetch tests against undici ^7.16.0 and @sapiom/axios against axios ^1.7.9, both dev-only. undici 7.30.1 closes every open undici 7 alert and axios 1.20.0 closes every open axios alert, so the floors move there. The axios peer range (>=1.0.0) is unchanged. axios is follow-redirects' only parent here, and the axios release that resolves requires follow-redirects ^1.16.2, which closes the follow-redirects alerts without an override. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sapiom/mcp and @sapiom/harness accepted @modelcontextprotocol/sdk ^1.26.0 and the lockfile resolved 1.29.0. 1.32.0 is the first release that closes every open SDK alert, so both floors move to ^1.32.0. The SDK depends on @hono/node-server, whose serveStatic double-decoding advisory has no 1.x fix (1.19.18 backports a different fix). A scoped override moves its 1.x line to the first patched 2.1.3, which the SDK's own range (^1.19.9 || ^2.0.5) allows. Overrides are not published: consumers resolve the SDK's range themselves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Studio web bundle builds with vite ^6.0.0, which resolved 6.4.3. 6.4.4 is the first 6.x release that closes the open Vite and bundled launch-editor alerts, so the floor moves there and the build stays on Vite 6 and its default browser target. Vitest 3's own copy of Vite moves with the Vitest commit that follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…[SAP-4715]
The createDefinitionSlugResolver.listVisible suite was declared inside
the "bounds network waits" test, so Vitest 3 collected none of its 10
tests. Vitest 4 rejects a suite declared inside a test ("Calling the
suite function inside test function is not allowed"), which would fail
the Vitest 4 upgrade that follows. Close the test before the suite so
it runs as a sibling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Vitest and @vitest/mocker advisories open on agent-map, harness, harness-desktop, mcp and opencode have no 3.x fix: the mocker redirect path traversal is fixed in 4.1.11 and the manual-mock registration injection in @vitest/mocker 4.1.12, which vitest 4.1.12 pins. Vitest 4 also drops tinypool, closing its two critical advisories. Its own Vite copy dedupes to the harness's patched Vite 6. Vitest 4 changes two things the suites relied on: - An untyped vi.fn() is typed as possibly constructable, so the harness handles that are called as functions get a callable Mock type. - restoreAllMocks no longer clears module-mock call history, so the mcp auth and credentials suites reset mocks before restoring them. Vitest 4 needs Node 20 or later (engines ^20 || ^22 || >=24), so the agent-map-node18 job stops running agent-map's unit suite, which still runs on Node 20 and 22 in the matrix job. The job keeps the mcp closure build and the packed-package checks on Node 18. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…P-4715] @sapiom/mcp and @sapiom/harness raise their @modelcontextprotocol/sdk range and @sapiom/agent-map and @sapiom/harness drop uuid, so all three get a patch release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3479033 to
ed3bcfb
Compare
…AP-4715] The @sapiom/axios suite stopped compiling when the lockfile moved axios from 1.18.0 to 1.21.1. `new MockAdapter(axiosInstance)` fails with TS2345 in both test files, so Jest runs no tests. A cached transform hid the failure on the first local run. axios ships two declaration files, index.d.ts for ESM and index.d.cts for CommonJS. ts-jest resolves "axios" to index.d.ts for this package's files and to index.d.cts for axios-mock-adapter. Up to 1.18.0 the two AxiosInstance types matched structurally. axios 1.19.0 made the request methods return AxiosResponseResult<T, R, D, P>, a conditional type on a unique symbol that each file declares for itself, so an AxiosInstance from one file is no longer assignable to an AxiosInstance from the other. Every patched release (1.20.0, 1.21.0, 1.21.1) fails the same way, and axios-mock-adapter 2.1.0 is the newest adapter, so no version choice fixes it. Map "axios" to index.d.cts in the ts-jest options. Those declarations describe the CommonJS build that Jest loads, and the test files, the package source and the adapter are then checked against the same file. No test file, source file or dependency changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
@gwitwer this is now cut down to the security fixes at their first patched versions, as you asked. It is ready for another look. Dropped
Kept
Result: the PR closes 142 open Dependabot alerts, including 137 and the Vite alerts 440, 442, 443, 455 and 456. The body lists every alert by package. Where I departed from your list
One thing for you to decide: three resolved versions are less than three days old: axios 1.21.1, vite 6.4.6 and follow-redirects 1.16.3. This repo sets no minimum release age and the playbook does not hold security fixes back, so I left them. axios 1.21.0, vite 6.4.5 and follow-redirects 1.16.2 close the same alerts if you would rather pin those. SAP-4715's "latest compatible" maintenance is not in this PR and needs its own ticket. |
AntoineMaillard06
left a comment
There was a problem hiding this comment.
Review summary
Purpose: Fix 142 Dependabot alerts at their first patched versions.
Changes: Raises dependency floors, adds scoped pnpm overrides, upgrades Vitest where required, adjusts Axios Jest declaration resolution, and refreshes the lockfile.
Before: Multiple vulnerable transitive versions remained, with outdated Vitest/Axios dependency configurations.
After: In-scope dependency paths resolve to patched versions; published package ranges, Node 18 consumer contracts, and lockfile reproducibility remain compatible.
Validation: Codex and Claude found no concrete blockers. Frozen install passed with an unchanged lockfile hash; audit findings fell from 240 to 84, with no remaining alerts for changed packages. Builds and focused tests passed across Axios, Fetch, LangChain, Agent Map, MCP, and changed Harness files. Broader timing/native-module failures reproduced on the base or were not attributable to this PR.
Verdict: Approved.
Primary change type
Problem and motivation
142 open Dependabot alerts on the root
pnpm-lock.yamland five package manifests have a patched release that this repository does not resolve yet. This PR closes all of them with the smallest version moves: each dependency goes to the lowest release that closes every open alert on its line, following Phase 2 of the dependency fix playbook.The review asked for this PR to become a security-only change. The earlier "latest compatible releases" maintenance (Vite 8,
@vitejs/plugin-react6, ts-jest, floors above the patched versions) is dropped. SAP-4715's "latest compatible" maintenance is not done by this PR and needs separate tracking.Summary and scope
Overrides (
pnpm-workspace.yaml). One key per vulnerable major line, each floored at its first patched release. No parent gets a major it did not declare, except four lines that have no patched release in their own major.fast-xml-parser@4,langsmith@0.3anduuid@9/uuid@10sit only in@sapiom/langchain-classic's dev-only@langchain/*0.3 test graph, and its suite passes on the new versions.toml@4sits undereffect, which callsToml.parse(content)only indist/unstable/cli/Primitive.js.@hono/node-server@1moves to^2.1.3, which@modelcontextprotocol/sdk1.32's own range (^1.19.9 || ^2.0.5) allows. Its 1.19.18 release backports a different fix, and its tarball has noallowPercentInPath, the #532 fix.Direct floors.
undici^7.30.1(@sapiom/fetch, dev),axios^1.20.0(@sapiom/axios, dev, with the peer range unchanged), harnessvite^6.4.4, and@modelcontextprotocol/sdk^1.32.0(@sapiom/mcp,@sapiom/harness). The unuseduuidand@types/uuiddeclarations leave@sapiom/agent-mapand@sapiom/harness, because neither imports them.axios suite type check (
packages/axios/jest.config.js). The axios floor broke the compilation of the@sapiom/axiossuite.new MockAdapter(axiosInstance)failed with TS2345 in both test files, so Jest ran no tests. axios ships one declaration file for ESM (index.d.ts) and one for CommonJS (index.d.cts). ts-jest resolvesaxiostoindex.d.tsfor this package's files and toindex.d.ctsforaxios-mock-adapter. Up to 1.18.0 the twoAxiosInstancetypes matched structurally. axios 1.19.0 made the request methods returnAxiosResponseResult<T, R, D, P>, a conditional type on aunique symbolthat each file declares for itself, so anAxiosInstancefrom one file is no longer assignable to anAxiosInstancefrom the other. Every patched axios fails the same way (1.20.0, 1.21.0 and 1.21.1 tested), andaxios-mock-adapter2.1.0 is its newest release, so no version choice fixes it. The fix mapsaxiostoindex.d.ctsin the suite's ts-jest options. Those declarations describe the CommonJS build that Jest loads, and the tests, the package source and the adapter are then checked against one file. No test file, source file, manifest or lockfile entry changes, and a wrong argument toMockAdapterstill fails the type check. A cast at the three call sites also compiles, but it turns the check off at those sites.Vitest
^4.1.12in agent-map, harness, harness-desktop, mcp and opencode. The Vitest and@vitest/mockeradvisories have no 3.x fix, and@vitest/mocker4.1.12, which vitest 4.1.12 pins, is the first release that fixes #458. Vitest 4 also drops tinypool. Its own Vite copy dedupes to the harness's Vite 6.4.6, so no Vite 8 enters the lockfile. The suites need three Vitest 4 adjustments. Six harness suites type theirvi.fn()handles as callableMocks. Two mcp suites callvi.resetAllMocks()beforevi.restoreAllMocks().definition-slug-resolver.test.tscloses a test before thelistVisiblesuite that was declared inside it. Vitest 3 skipped those 10 tests silently, and Vitest 4 fails the file ("Calling the suite function inside test function is not allowed"). That fix is its own commit and passes on both Vitest versions.CI. Vitest 4 declares
engines.node^20.0.0 || ^22.0.0 || >=24.0.0, soagent-map-node18stops running agent-map's unit suite, which still runs on Node 20 and 22 in the matrix job. The job keeps the mcp closure build and the packed-package checks on Node 18.Removed overrides.
baseline-browser-mapping,follow-redirects,nanoidandsource-map-jsneed no key. The browserslist, axios and postcss releases that resolve require^2.11.33,^1.16.2,^3.3.20and^1.2.2. Dropping each key one at a time and regenerating frommain's lockfile reopens no alert.Dropped at the reviewer's request. Vite 8 and
@vitejs/plugin-react6, along with theagent-map-authority.spec.tsedit that existed only for Vite 8's tab-indented output. The ts-jest bump in 15 packages. Floors above the first patched release, which came down: langsmith^0.11.7to^0.6.0, hono^4.13.16to^4.13.11, MCP SDK^1.32.2to^1.32.0, axios^1.21.0to^1.20.0,@hono/node-server^2.1.6to^2.1.3, fast-xml-parser^5.11.2to^5.7.0, browserslist^4.29.5to^4.28.7, ip-address^10.7.5to^10.7.4, postcss^8.5.32to^8.5.23, and qs^6.17.1to^6.16.1.Out of scope. Open alerts this PR does not touch: electron, tar, app-builder-lib and builder-util-runtime (the desktop Electron upgrade), zod,
@xmldom/xmldom, extract-zip and deepmerge (no patched release), effect, glob, minimatch, and every alert underexamples/.Alerts closed
The floor is the first patched version that closes every listed alert. "Resolved" is the version the lockfile picks within that floor.
main@hono/node-server@modelcontextprotocol/sdk@vitest/mockeraxiosbaseline-browser-mappingbody-parserbrace-expansionbrowserslistdompurifyfast-urifast-xml-parserfollow-redirectshandlebarshonoip-addressjs-yamllangsmithnanoidpostcssproxy-addrqssource-map-jstinypooltomlundiciuuidvitevitestlangsmith0.8.0 (under@langchain/core1.x),nanoid6.0.1 anduuid14.0.2 also resolve onmainand are not vulnerable. They do not move.Lockfile
pnpm-lock.yamlis whatgit checkout origin/main -- pnpm-lock.yaml && pnpm installproduces from the final manifests, byte for byte. Each commit's lockfile is regenerated the same way. One field is restored by hand: pnpm 10.34.3 drops theintegrityof the git-hosted@electron/node-gyptarball on rewrite, and the lockfile keepsmain's value. 65 packages change resolved versions againstmain. 28 are the packages in the table above, and 37 are passengers that the patched parents pull in or drop:@vitest/*4.1.12, chai 6, es-module-lexer 2, std-env 4, tinyexec 1, tinyrainbow 3 and obug are added. cac, check-error, deep-eql, js-tokens 9, loupe, pathval, strip-literal, tinyspy and vite-node are removed.@nodable/entities, fast-xml-builder, is-unsafe, path-expression-matcher and xml-naming.main's 2.0.0 and 0.7.2.@types/uuid. Its new optionalwspeer re-keys@langchain/core0.3.80's snapshot at the same version.Related work
Related issue or discussion: internal tracking SAP-4715 (security part only; the "latest compatible" maintenance needs its own ticket). Supersedes the single-package override PRs #1209 and #1211, and overlaps the root-workspace parts of the Dependabot PRs #1092 and #1097.
Validation
All of the following ran at
30eb44eb, the current head, on Node 22.23.4 and pnpm 10.34.3, one package at a time on 3 CPUs. No cache was in play. Build output was removed before the build, every Jest suite ran with--no-cacheand an empty cache directory, and the Vitest cache directories were deleted first.The axios suite is the one that the previous head broke. With
--no-cache,pnpm --filter @sapiom/axios testgives these results:A run at
ed3bcfbathat reuses Jest's transform cache from before the lockfile change passes with 33 tests, so only a run without the cache shows the failure.These ran at
ed3bcfbaand were not rerun, because the only later change ispackages/axios/jest.config.js:An independent rerun of the two Playwright shards at
ed3bcfbafinished with 547 passed and 3 failed (dialog-shell.spec.ts:67,smoke.spec.ts:43andsmoke.spec.ts:1249). The traces show module requests that failed with Chromium'snet::ERR_NETWORK_CHANGED. Each failed case then passed every focused repeat on this branch and onmain(15 runs of the dialog case and 10 of each smoke case), and both CI shards passed. The failure was not reproduced onmain, so it is not proven to predate this PR.Alert closure was checked by a script that tests every npm range of each advisory against every version of the package resolved in the lockfile. Before this PR,
mainresolves a vulnerable version for all 142 alerts. After it, none do.Flaky tests seen, not caused by this PR:
packages/harness/src/core/record-archive.test.ts"picks up a record written by another process after its index was built" failed once in the full harness run. Run alone 15 times under the same pinning, it fails 8 of 15 onmain(Vitest 3.2.6) and 5 of 15 on this branch. The full-suite rerun passed.web/e2e/agent-map-release.spec.ts(two variants) timed out once in the first shard 1/2 run. It passed in two isolated runs and in the shard 1/2 rerun.Not verified locally:
agent-map-node18job, because this machine has no Node 18 binary.@sapiom/mcploads the SDK'sserver/mcp.js,server/stdio.jsandtypes.js. Their import graph reaches 16 files and never imports@hono/node-server, which onlyserver/streamableHttp.jsand the SDK's examples import.libgtk-3.so.0. Packing succeeds.pnpm examples:test, which installs each template from published npm ranges that this PR does not change.Tests and documentation
No new tests, because this is a dependency update. The existing suites were adapted to Vitest 4 as listed above. The
@sapiom/axiossuite needed one ts-jest option and no test edits. ThelistVisiblefix turns on 10 tests that never ran before. No user-facing documentation changes.Compatibility and release impact
@sapiom/mcpand@sapiom/harnessrequire@modelcontextprotocol/sdk1.32.0 or later within 1.x.@sapiom/agent-mapand@sapiom/harnessdrop the unuseduuiddependency. The Studio web bundle stays on Vite 6 and its default browser target. Overrides shape only this repository's lockfile and are not published..changeset/mcp-sdk-floor-and-unused-uuid.md, patch for@sapiom/mcp,@sapiom/harnessand@sapiom/agent-map).Security
will follow the
Security Policy for
private reporting.
AI assistance
Claude Code (Opus) rebuilt this branch from the review. It built the alert ledger from the Dependabot API, chose each floor, regenerated every commit's lockfile from
main's, tested each override key for necessity, ran the validation above, and wrote this description. The ledger, the lockfile diff and the scripts that produce them can be rerun. A later Claude Code session (Fable) found the cause of the axios suite's compile failure, which an independent verification run had reported, made thejest.config.jschange, and reran the checks above with caches off. The change goes through independent review before it is marked ready.Checklist
CONTRIBUTING.md, and this contribution follows the direct-PR or issue-first policy.any N/A checks above.
🤖 Generated with Claude Code
Summary by CodeRabbit