fix(deps): resolve open Dependabot alerts

Merged
AV
1mo ago
+175-113

Summary

Resolves all 13 open Dependabot alerts (all npm), including 3 critical:

PackageBumpManifestsAlerts
simple-git3.36.0 → 4.0.2apps/desktop, packages/host-service#317, #321 (critical): unsafe-operation guard misses trailer command config · #316, #320 (high): command execution through Git config includes · #315, #319 (high): unsafe-operations bypass through abbreviated long options
shell-quote1.9.0 → 1.11.0apps/desktop, root overrides#322 (critical): quote() command injection via a line terminator after a { comment } token
@modelcontextprotocol/sdk1.30.0 → 1.31.0apps/api, apps/docs, packages/cli, packages/mcp, packages/trpc#323–#327 (high): OAuth client could send credentials to an authorization server chosen by the MCP server
katex0.17.0 → 0.18.2apps/mobile#318 (low): prototype pollution can bypass trust restrictions

Also adds a root override @modelcontextprotocol/sdk: 1.31.0, so the copies under expo-mcp and shadcn (both ^1.26.0) move to the patched version too.

This replaces the Dependabot PRs #8197, #8198 and #8211. #8197 bumped simple-git in host-service only (red on Typecheck/Test/Sherif). #8211 left the root shell-quote: 1.9.0 override in place, so the lockfile still resolved 1.9.0.

simple-git 4 migration

simple-git 4 is a major version, so this is more than a version pin:

  • Named export. v4 removes the default export: import simpleGit from "simple-git" → import { simpleGit } from "simple-git" (2 wrappers + 21 test files).
  • Environment guard. v4 throws when a GIT_*, EDITOR, PAGER, PREFIX, SSH_ASKPASS or VISUAL key reaches the child through .env() unless the key is listed in allowEnvironment, and it strips such keys inherited from process.env. That list is read once, when the instance is built. Today the desktop passes the whole shell env through .env(), and host-service chains .env(gitEnv) (with GIT_ASKPASS, GIT_TERMINAL_PROMPT, GIT_OPTIONAL_LOCKS, …) onto createUserSimpleGit() at about 25 call sites. A plain bump would make every credentialed git call, and any desktop git call for a user with EDITOR set, fail at runtime with Use of "EDITOR" is blocked by the environment guard. Typecheck does not catch this.
    • New userGitSimpleGitOptions(env) in @superset/shared/simple-git-options builds allowEnvironment from the env being passed.
    • Host-service createUserSimpleGit(baseDir, { env }) takes the env at construction, and every .env() chain moves to that option. Called without env, it allows the ambient process.env keys, as v3 did.
    • The desktop getSimpleGitWithShellPath resolves the shell env first, then builds the client with it.
  • Unsafe flags. Adds the v4 flags (allowUnsafeCommandBinaries, allowUnsafeExec, allowUnsafeInclude, allowUnsafeSubmodule, allowUnsafeUrlRewrite, allowAbbreviatedOptions) to the shared allow-list.

Reviewer note on policy: this keeps the policy from #4602, where Superset is the user's own Git client and honors their Git env and config, so every simple-git unsafe guard is enabled. The alerts close because the vulnerable versions are gone, but the new v4 argument guards stay opted out, as the v3 ones already were. allowAbbreviatedOptions is included because otherwise v4 sets GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS=true in git's env, and that reaches the user's own hooks. If we want to narrow the policy for calls that carry untrusted input (PR head refs, remote URLs), that should be a separate change.

Other bumps

  • @modelcontextprotocol/sdk 1.31.0 adds an issuer field to stored OAuth tokens. No code here uses the SDK's OAuth client storage.
  • katex 0.18.0 prefixes its internal CSS classes. In mobile, katex is only an optional peer of react-native-enriched-markdown, which uses it in its web renderer, and the app is iOS-only.
  • mermaid still pulls its own katex@0.16.47 (^0.16.47 excludes 0.18.x). Dependabot does not flag it; it clears when mermaid widens its range.

Test plan

  • bun install: lockfile changes only the bumped packages; native modules rebuilt
  • bun run lint:fix and bun run lint: clean
  • bun run sherif: no issues
  • bun run typecheck: clean in shared, host-service, desktop, trpc, mcp, cli, api and docs (after relinking this checkout with bun@1.4.2 install --frozen-lockfile --ignore-scripts to repair a local better-auth install split; no tracked files change). apps/mobile (after host-service build:types) has 11 errors, all unref on number in packages/port-scanner and packages/workspace-fs, which this PR does not touch. Under the earlier local install, mobile's error set was identical to main.
  • packages/host-service tests: 2312 pass, 0 fail
  • packages/shared tests: 1303 pass, 0 fail
  • packages/trpc (492), packages/cli (372), apps/api (230): all pass
  • apps/desktop tests: 7684 pass, 209 fail. All 209 are the known local Bun 1.3.14 --isolate Lingui shim failures ("useLingui hook was used without I18nProvider" / "without setting a locale"); none are in git code and none mention simple-git
  • New regression test: createUserSimpleGit(…, { env }) passes GIT_CONFIG_* through to git. Checked by mutation: it fails with allowEnvironment emptied
  • Manual smoke test of desktop git flows (status, commit, push over SSH/HTTPS) on a dev build. Not run in this session

Summary by CodeRabbit

  • Bug Fixes
    • Git operations now consistently use the environment settings provided for each operation, including Git configuration and credentials. This helps ensure actions such as cloning, fetching, and checking repository status run with the intended settings.