fix(deps): remediate dependency security vulnerabilities (165→16, 4 critical→0) - #3406
Merged
Conversation
Comprehensive dependency-security pass. Reduces `bun audit` from 165 findings (4 critical / 58 high) to 16 (0 critical / 10 high / 3 moderate / 3 low). All changes stay within declared version ranges; bun.lock is a clean regeneration. Direct bumps (vulnerable instance was the direct dep): - better-auth 1.4.22 -> ^1.6.13 (CVE-2026-53512, CVSS 9.1 OAuth refresh-token replay; mcp/oidcProvider plugin is enabled in apps/api) - next -> ^16.2.6 (middleware/proxy bypass, SSRF, DoS) - axios -> ^1.16.0 (proxy-auth credential leak, prototype pollution) - vitest -> ^3.2.6, vite -> ^6.4.3, turbo -> ^2.10.5 Dead-dep removal (unused, referenced by no script): - gitmoji -> cascade-drops request, tough-cookie@2.5.0, tar@2.2.2, node-gyp@3 - semantic-release-discord + -notifier -> drops discord.js/@discordjs/rest (which pinned undici@6 and blocked patching it). The real release->Discord notification is a separate webhook GitHub Action (no npm deps) - untouched. Parent bumps (newer parent pulls a patched child): - @browserbasehq/stagehand -> ^3.7.0 (drops langchain + langsmith) - @nestjs/swagger -> ^11.4.5 (patched js-yaml 4.3.0) Overrides for transitive vulns (backcompat-safe, verified): - axios, form-data, ws, semver, hono, @hono/node-server, multer, systeminformation, tmp, dompurify, ip-address, postcss, prismjs, qs, effect, protobufjs, linkify-it, mermaid, shell-quote, vite, @opentelemetry/core, @sigstore/core, markdown-it, @babel/core - @tiptap/* pinned 3.22.1 (lockstep; the lockfile regen floated the transitive @tiptap/* apart from @tiptap/react@3.22.1) undici NOT force-overridden across majors (discord.js path removed; the lockfile regen floats v6->6.27.0 and v7->7.28.0 within ranges instead). Verified: full `turbo build` (20/20) + typecheck (0 production errors) across all apps; apps/api Dockerfile.multistage builds clean and boots past module-load (better-auth 1.6 loads; stops only at the expected SECRET_KEY env guard). openapi.json intentionally untouched (no API files changed). Remaining 16 are all dev/build-time or no-upstream-fix: tar (electron-builder/giget/npm-bundled), minimatch (npm-bundled), esbuild (dev-server only), uuid (exceljs, no v8 fix), sigstore (release CI), cookie (disjoint majors), @ai-sdk/provider-utils (low, via stagehand). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
better-auth 1.6 types role `statements` as readonly tuples
(ExactRoleStatements = { readonly [P]: readonly [...] }), so casting
`role.statements as Record<string, string[]>` (mutable) is an invalid
conversion and fails `next build`'s TypeScript check on Vercel:
Type 'readonly ["read"]' cannot be assigned to the mutable type 'string[]'
Widen `mergePermissions`'s `source` param to `Record<string, readonly
string[]>` (it only reads, never mutates) and cast to the readonly type.
Verified against better-auth@1.6.23 dist types; the only `.statements`
cast in the app (other Record<string,string[]> casts are on JSON/any).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 tasks
claudfuen
pushed a commit
that referenced
this pull request
Jul 15, 2026
# [3.102.0](v3.101.2...v3.102.0) (2026-07-15) ### Bug Fixes * **ci:** pin Syft 1.46.0 in SBOM action (1.42.3 can't parse bun.lock) ([#3415](#3415)) ([5f47024](5f47024)) * **ci:** scan bun.lock via file: input so the SBOM isn't empty ([#3414](#3414)) ([e47e6fd](e47e6fd)) * **deps:** override uuid to ^11.1.1 (Dependabot [#85](#85)) ([#3418](#3418)) ([598ff8c](598ff8c)) * **deps:** patch tmp and js-yaml in mcp-server (Dependabot [#58](https://github.com/trycompai/comp/issues/58)/[#59](https://github.com/trycompai/comp/issues/59)/[#71](https://github.com/trycompai/comp/issues/71)) ([#3412](#3412)) ([59a6b0f](59a6b0f)) * **deps:** remediate dependency security vulnerabilities ([#3403](#3403)) ([7577a37](7577a37)) * **deps:** remediate dependency security vulnerabilities (165→16, 4 critical→0) ([#3406](#3406)) ([d403e9c](d403e9c)) * **device-agent:** implement the installer-cleanup fix ([#3381](#3381)) ([0f7581b](0f7581b)) * **security:** prevent SSRF in task-automation enterprise API calls ([#3411](#3411)) ([dcec288](dcec288)), closes [#116](#116) * **security:** resolve open CodeQL alerts (XSS, sanitization, workflow perms) ([#3419](#3419)) ([32329be](32329be)), closes [#108](#108) [js/xss-throu#dom](https://github.com/js/xss-throu/issues/dom) [#95](#95) [84/#85](#85) ### Features * **framework-editor:** raise requirement description limit to 100,000 chars (FRAME-2) ([67c9f4a](67c9f4a))
Contributor
|
🎉 This PR is included in version 3.102.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive dependency-security remediation. Reduces
bun auditfrom 165 findings (4 critical / 58 high) → 16 (0 critical / 10 high / 3 moderate / 3 low). Clean single commit offmain; all changes stay within declared version ranges andbun.lockis a clean regeneration.What changed
Direct bumps (the vulnerable instance was the direct dep):
1.4.22 → ^1.6.13mcp()/oidcProvideris enabled in apps/api→ ^16.2.6→ ^1.16.0fs.denybypass / —Dead-dep removal (unused, referenced by no script):
gitmoji→ cascade-dropsrequest,tough-cookie@2.5.0,tar@2.2.2,node-gyp@3semantic-release-discord+-notifier→ dropsdiscord.js/@discordjs/rest(pinnedundici@6). The actual release→Discord notification is a separate webhook GitHub Action, no npm deps — untouched.Parent bumps:
@browserbasehq/stagehand → ^3.7.0(drops langchain + langsmith),@nestjs/swagger → ^11.4.5(patched js-yaml).Overrides for transitive vulns (backcompat-safe): axios, form-data, ws, semver, hono, @hono/node-server, multer, systeminformation, tmp, dompurify, ip-address, postcss, prismjs, qs, effect, protobufjs, linkify-it, mermaid, shell-quote, vite, @opentelemetry/core, @sigstore/core, markdown-it, @babel/core — plus
@tiptap/* → 3.22.1(lockstep pin).Lockfile regen floats remaining stale transitives to patched in-range:
undici6.27.0 + 7.28.0,js-yaml3.15.0 + 4.3.0,brace-expansion,minimatch(non-bundled),@sigstore/verify3.1.1.Verification
turbo build— 20/20 tasks pass (caught + fixed a tiptap lockstep break from the regen).spec.tsdebt on main)apps/api/Dockerfile.multistagebuilds clean — freshbun install(oven/bun:1.2.8) + package builds +nest buildSECRET_KEYenv guardopenapi.jsonnot touched (no API endpoint files changed)Remaining 16 (all dev/build-time or no upstream fix)
tar(electron-builder/giget/npm-bundled),minimatch(npm-bundled),esbuild(dev-server only),uuid(exceljs pins v8, no fix),sigstore(release CI),cookie(disjoint majors),@ai-sdk/provider-utils(low, via stagehand). None are prod-runtime-reachable with a safe fix available.Follow-up
Tree-shaking (removing unused deps) will be its own PR — knip flags ~124 but it's noisy (confirmed false positives and negatives), so it needs a configured, build-verified pass.
Test plan
🤖 Generated with Claude Code
Summary by cubic
Cuts
bun auditfindings from 165 (4 critical) to 16 (0 critical) by upgrading, pinning, and removing dependencies, and fixes a TS mismatch withbetter-auth1.6 role statements in the app. No runtime changes; full build, typecheck, and API Docker image verified.Dependencies
better-auth→ ^1.6.23,axios→ ^1.16.0; dev tooling (vite/vitest/turbo) to latest in-range; bumped@browserbasehq/stagehand→ ^3.7.0 and@nestjs/swagger→ ^11.4.5.gitmoji,semantic-release-discord, andsemantic-release-discord-notifier(drops oldundici@6chain).@tiptap/*to 3.22.1; regeneratedbun.lock.Bug Fixes
mergePermissionsacceptreadonlyarrays and castrole.statementsaccordingly to matchbetter-auth1.6 types, fixing Next build TypeScript errors.Written for commit a068e84. Summary will update on new commits.