Skip to content

chore(deps): fix security audit findings (backend 33→22 incl. critical, frontend 40→0)#139

Merged
recabasic merged 3 commits into
CaviraOSS:mainfrom
tongshu2023:chore/security-audit-fixes-138
Jun 10, 2026
Merged

chore(deps): fix security audit findings (backend 33→22 incl. critical, frontend 40→0)#139
recabasic merged 3 commits into
CaviraOSS:mainfrom
tongshu2023:chore/security-audit-fixes-138

Conversation

@tongshu2023

Copy link
Copy Markdown
Contributor

Summary

Works through the automated security audit findings from #138 (and the earlier weekly issues #135/#134/#133).

Backend: 33 → 22 advisories (critical eliminated) · Frontend: 40 → 0

Backend (npm audit fix --legacy-peer-deps)

  • Clears the critical protobufjs advisory and 4 highs (fast-xml-parser/fast-xml-builder, @xmldom/xmldom, underscore, cacache chains) plus assorted moderates — all within existing semver ranges.
  • --legacy-peer-deps matches the repo's current install reality: the lockfile already contains an openai@6 vs @browserbasehq/stagehand (openai@^4 peer) conflict that a strict npm install refuses to resolve.
  • Verified: npm run build (tsc) clean.

The 22 that remain need maintainer decisions

  1. @keyv/sqlitesqlite3 chain (9 advisories, all install-time)sqlite3@5.1.7 is the final release of an unmaintained package; the node-gyp/tar/make-fetch-happen advisories live in its build toolchain, not the runtime. Options: switch the Keyv store to better-sqlite3-based storage, or accept the risk as install-time-only.
  2. LangChain 0.3 → 1.x (13 advisories incl. the langsmith highs) — a real API migration, too invasive to bundle into an audit PR. Happy to attempt it as a separate PR if wanted.

Frontend

  • pnpm update within existing semver ranges clears 39 of 40 (react-router XSS/DoS series, minimatch/picomatch ReDoS, flatted, postcss, rollup, etc.).
  • The last one — critical shell-quote 1.8.3 — is exactly pinned by concurrently@9.x, so concurrently is bumped 9 → 10 (dev-only script runner; v10 ships shell-quote 1.8.4).
  • Verified: pnpm run build (tsc + vite) clean.

Verification

  • Backend: npm run build exit 0
  • Frontend: pnpm audit → "No known vulnerabilities found"; pnpm run build exit 0

…->0)

Addresses the automated security audit issues (CaviraOSS#138 and earlier).

Backend (npm audit fix --legacy-peer-deps):
- Clears the critical protobufjs advisory and 4 highs
  (fast-xml-parser/builder, @xmldom/xmldom, underscore chains)
- 33 -> 22 vulnerabilities; tsc build verified clean

Frontend (pnpm update within semver + concurrently 9->10 devDep):
- Clears all 40 advisories including the critical shell-quote one
  (concurrently 9.x pins shell-quote 1.8.3; v10 ships 1.8.4)
- 40 -> 0 vulnerabilities; vite build verified clean

The 22 remaining backend advisories all require maintainer decisions:
- 9 come through @keyv/sqlite -> sqlite3 -> node-gyp/tar (install-time
  toolchain of an unmaintained package)
- 13 require the langchain 0.3 -> 1.x major migration
Plain `npm install` fails with ERESOLVE on the pre-existing openai@6 vs
@browserbasehq/stagehand (peer openai@^4) conflict, which is why the CI
pipeline fails intermittently on main. This makes installs deterministic
for CI and contributors until the conflict is resolved upstream.
…rides

sqlite3@5.1.7 (final release, unmaintained) pulls node-gyp 8.x with
vulnerable tar/cacache/make-fetch-happen. Pinning the toolchain to
current patched versions clears 6 of the 7 remaining high advisories.
tsc build verified; sqlite3 installs via prebuilt binaries so the
node-gyp bump only affects the source-build fallback path.

The last high (langsmith) plus 9 moderates all sit behind the
langchain 0.3 -> 1.x migration and are left for a dedicated PR.
@tongshu2023

Copy link
Copy Markdown
Contributor Author

Two follow-up commits after watching CI:

  1. a68dd47.npmrc with legacy-peer-deps=true: the "Validate Code" job was failing in npm install on a pre-existing openai@6 vs @browserbasehq/stagehand (peer openai@^4) ERESOLVE conflict — the same reason the pipeline fails intermittently on main. With the .npmrc, installs are deterministic for CI and contributors; Validate Code now passes.
  2. d132770 — toolchain overrides: sqlite3@5.1.7 (final release of an unmaintained package) pulls node-gyp@8 with vulnerable tar/cacache/make-fetch-happen. Pinning those to patched versions clears 6 of the 7 remaining highs. sqlite3 installs via prebuilt binaries, so the node-gyp bump only affects the source-build fallback.

Backend now: 33 → 10 (1 high + 9 moderate) — everything left sits behind the LangChain 0.3 → 1.x migration (incl. the langsmith advisories, whose patched releases require langchain 1.x-era APIs; force-overriding it against @langchain/core@0.3 would risk runtime breakage, so I left it for a dedicated migration PR).

Remaining CI reds are environmental: the "Dependency Vulnerability Check" gate (npm audit --audit-level=high) will stay red until the langchain migration lands (it's red on main too), and the Docker job failed on a registry-1.docker.io timeout — worth a re-run.

@recabasic recabasic merged commit ef69bdf into CaviraOSS:main Jun 10, 2026
2 of 4 checks passed
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.

2 participants