Skip to content

Patch transitive dependency vulnerabilities via npm overrides - #15

Closed
jhamon wants to merge 1 commit into
mainfrom
deps/override-transitive-vulns
Closed

Patch transitive dependency vulnerabilities via npm overrides#15
jhamon wants to merge 1 commit into
mainfrom
deps/override-transitive-vulns

Conversation

@jhamon

@jhamon jhamon commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What & why

The repo has ~69 open Dependabot alerts, essentially all in transitive dependencies pulled in by three heavyweight direct deps (@xenova/transformers, danfojs-node, and vitest). This PR takes the low-risk, high-coverage first pass: an npm overrides block pinning patched versions of the vulnerable transitive packages.

No source changes. Build succeeds, all 14 tests pass, and danfojs-node (tfjs-node native) + sharp load and execute at runtime after the bumps.

Result

npm audit: 46 → 28 vulnerabilities.

Severity Before After
critical 4 2
high 20 11
moderate 19 12
low 3 3

Notable fixes

  • form-data 2.3.3/3.0.1 → 4.0.6 — critical: unsafe random boundary + CRLF injection
  • protobufjs 6.11.3 → 6.11.6 — critical: prototype pollution / arbitrary code execution (6.11.x line)
  • sharp 0.32.1 → 0.32.6 — high: libwebp CVE-2023-4863
  • tar → 6.2.1, semver → 7.x, ws → 7.5.11, plus qs, micromatch, braces, cross-spawn, minimatch, picomatch, word-wrap, brace-expansion, tar-fs, @babel/runtime, js-yaml, flatted, yaml, @protobufjs/utf8 — assorted ReDoS / prototype-pollution fixes

Deliberately left for follow-up (no safe in-range fix)

  • protobufjs / onnxruntime-web / onnx-proto critical — reachable only via the browser ONNX backend, which this Node CLI never executes (embeddings run through onnxruntime-node). No fix on the 6.x line, and forcing 7.x risks the version pinned by @xenova/transformers.
  • vitest critical + vite/rollup/esbuild — dev-only (Vitest UI server); needs a vitest v3 major upgrade.
  • xlsx / request / lodash cluster — pulled in by danfojs-node, used only for trivial CSV parsing. xlsx (SheetJS) and lodash 4.17.21 have no published npm fix. Best addressed by dropping danfojs-node and inlining the small CSV piece we use (matches the pattern of Bump @pinecone-database to v2.0.0 #6).

Verification

  • npm install — clean
  • npm run build — success
  • npm test — 14/14 pass
  • Runtime smoke test — danfojs-node DataFrame ops + sharp PNG encode both work

🤖 Generated with Claude Code

Adds an `overrides` block pinning patched versions of vulnerable
transitive dependencies. No source changes; build and all 14 tests
pass, and danfojs-node (tfjs-node) + sharp load and run at runtime.

npm audit: 46 -> 28 vulnerabilities (critical 4->2, high 20->11,
moderate 19->12).

Notable fixes:
- form-data 2.3.3/3.0.1 -> 4.0.6 (critical: unsafe random boundary,
  CRLF injection)
- protobufjs 6.11.3 -> 6.11.6 (critical: prototype pollution /
  arbitrary code execution in the 6.11.x line)
- sharp 0.32.1 -> 0.32.6 (high: libwebp CVE-2023-4863)
- tar 4.4.19/6.1.15 -> 6.2.1, semver -> 7.x, ws -> 7.5.11, plus
  qs, micromatch, braces, cross-spawn, minimatch, picomatch,
  word-wrap, brace-expansion, tar-fs, @babel/runtime, js-yaml,
  flatted, yaml, @protobufjs/utf8 ReDoS / prototype-pollution fixes

Deliberately left for follow-up PRs (no safe in-range fix):
- protobufjs / onnxruntime-web / onnx-proto critical: only reachable
  via the browser ONNX backend, which this Node CLI never executes;
  no fix on the 6.x line and forcing 7.x risks the pinned backend.
- vitest critical + vite/rollup/esbuild: dev-only; needs a vitest v3
  major upgrade.
- xlsx / request / lodash cluster: pulled in by danfojs-node for CSV
  parsing; xlsx and lodash have no published npm fix. Best addressed
  by dropping danfojs-node (used only for trivial CSV work).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jhamon jhamon closed this Jul 8, 2026
@jhamon
jhamon deleted the deps/override-transitive-vulns branch July 8, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant