Repository navigation
Commit d403e9c
fix(deps): remediate dependency security vulnerabilities (165→16, 4 critical→0) (#3406)
* fix(deps): remediate dependency security vulnerabilities (165 -> 16)
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>
* fix(app): make permissions readonly-compatible for better-auth 1.6
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>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 7577a37 commit d403e9c
5 files changed
Lines changed: 1665 additions & 1742 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
242 | 245 | | |
243 | 246 | | |
244 | 247 | | |
| |||
0 commit comments