Skip to content

chore(deps): resolve Dependabot critical/high/moderate alerts#394

Merged
pasevin merged 3 commits into
mainfrom
chore/dependabot-batch
Jun 6, 2026
Merged

chore(deps): resolve Dependabot critical/high/moderate alerts#394
pasevin merged 3 commits into
mainfrom
chore/dependabot-batch

Conversation

@pasevin

@pasevin pasevin commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Single-PR sweep of open Dependabot advisories on ui-builder. Knocks out 4 criticals, most highs, and most moderates by bumping direct deps and migrating + adding workspace pnpm overrides.

Direct dep bump

  • vitest + @vitest/coverage-v8 ^3.2.4^4.1.0 in root + apps/builder — patches GHSA-5xrq-8626-4rwp (arbitrary file read/exec via Vitest UI server). Resolves to 4.1.8.

Override migration: package.json#pnpmpnpm-workspace.yaml

pnpm v11 silently ignores package.json#pnpm.overrides. The existing overrides (valtio, vite, midnight-js-*, etc.) were already inert. Verified: pre-PR valtio resolved to 1.11.2 despite override declaring ^1.13.2; post-PR correctly resolves to 1.13.2. vite was stuck at both 7.3.1 and 7.3.2 — now only 7.3.2.

minimumReleaseAge and patchedDependencies migrated the same way; vitest / @vitest/* added to minimumReleaseAgeExclude since some metadata is missing the time field.

New security overrides

Advisory(ies) Package Fix
15× axios CVEs (prototype pollution, SSRF, ReDoS, header injection, etc.) axios <1.16.0^1.16.0
15× hono CVEs hono <4.12.21^4.12.21
8× protobufjs CVEs (RCE, DoS, prototype pollution) protobufjs <7.5.8^7.5.8
GHSA-q6x5-8v7m-xcrf @protobufjs/utf8 <1.1.1^1.1.1
GHSA-ph9p-34f9-6g65 tmp <0.2.6^0.2.6
GHSA-r5fr / f23m / xxjr lodash <4.18.0^4.18.0
GHSA-7r86-cg39-jmmj minimatch <3.1.3 and ^9 <9.0.7 → patched
GHSA-v39h / q3j6 fast-uri <=3.1.1^3.1.2
GHSA-qj3p-xc97-xw74 @metamask/sdk + …-communication-layer <0.33.1^0.33.1
GHSA-v2v4-37r5-5v8g ip-address <=10.1.0^10.1.1
GHSA-3v7f-55p6-f55p picomatch >=4 <4.0.4^4.0.4
GHSA-r4q5-vmmm-2653 follow-redirects <=1.15.11^1.16.0
GHSA-qx2v-qp2m-jg93 postcss <8.5.10^8.5.10

Vitest 4 compatibility fixes

Config (apps/builder/vitest.config.ts)

  • Removed deprecated test.poolOptions (rolled into top-level pool options in v4).
  • Added server.fs.allow for the sibling openzeppelin-adapters checkout so adapter patch-file imports in export tests don't trip vite's fs.deny.

Test mocks (5 files) — vitest 4 / tinyspy 4 use Reflect.construct(impl, args) for new, which throws on arrow-function impls per ES spec. Converted:

  • apps/builder/src/export/__tests__/PackageManager.test.ts
  • apps/builder/src/export/__tests__/VersioningSafetyGuard.test.ts
  • apps/builder/src/export/assemblers/__tests__/copyAdapterPatchFiles.test.ts
  • apps/builder/src/export/generators/__tests__/AppCodeGenerator.test.ts
  • apps/builder/src/export/assemblers/__tests__/generateAndAddAppConfig.test.ts (vi.spyOn over an existing vi.fn() no longer auto-clears prior calls — added explicit mockClear() before counting).

Not fixed in this PR (justifications for dismissal)

Alert Reason
uuid 8.x/9.x — GHSA-w5hq-g745-h8pq CVE only affects v3/v5/v6(buf). Solana web3.js / MetaMask utils call v4() only. Forcing ^11 breaks @solana/web3.js peer constraints.
elliptic 6.6.1 — GHSA-848j-6mx2-7j84 No upstream patch exists.
bigint-buffer 1.1.5 — GHSA-3gc7-fjrx-p6mg No upstream patch; transitive via @solana/spl-token.

Test plan

  • pnpm install succeeds; lockfile regenerated cleanly
  • pnpm -r typecheck passes
  • pnpm test — all 311 tests pass (apps/builder 306, scripts 5) on vitest 4.1.8
  • Verified vulnerable copies purged from pnpm-lock.yaml:
    • vite 7.3.1 → only 7.3.2
    • axios 1.13.6/1.14.0 → only 1.16.1
    • hono 4.12.124.12.23
    • protobufjs 7.4.07.6.0
    • tmp 0.0.330.2.7
    • lodash 4.17.214.18.1
    • fast-uri 3.1.03.1.2
    • picomatch 4.0.34.0.4
    • follow-redirects 1.15.111.16.0
    • postcss 8.5.88.5.15
    • ip-address 10.1.010.2.0
    • @metamask/sdk* 0.32.00.33.1 only
    • valtio 1.11.21.13.2 (proves the workspace migration is effective)

pasevin added 2 commits June 6, 2026 13:39
Direct bumps:
- vitest + @vitest/coverage-v8: ^3.2.4 → ^4.1.0 (patches GHSA-5xrq-8626-4rwp,
  critical, arbitrary file read/exec via Vitest UI server).

Override migration: package.json#pnpm.overrides → pnpm-workspace.yaml#overrides.
pnpm v11 silently ignores the package.json variant — every existing override
(valtio, vite, midnight-js-*, etc.) was inert until this migration. Verified
by inspecting the lockfile: valtio resolved to 1.11.2 pre-PR despite override
saying ^1.13.2; now correctly resolves to 1.13.2.

New security overrides:
- axios <1.16.0 → ^1.16.0 (15 advisories: prototype pollution, SSRF,
  header/CRLF injection, ReDoS, etc.)
- hono <4.12.21 → ^4.12.21 (15 advisories: cookie injection, JWT issues,
  cache-leakage, path traversal, etc.)
- protobufjs <7.5.8 → ^7.5.8 (8 advisories: DoS, RCE, prototype pollution)
- @protobufjs/utf8 <1.1.1 → ^1.1.1 (overlong UTF-8 decoding)
- tmp <0.2.6 → ^0.2.6 (path traversal via symlink)
- lodash <4.18.0 → ^4.18.0 (code injection, prototype pollution)
- minimatch <3.1.3 / ^9 <9.0.7 → patched (ReDoS)
- fast-uri <=3.1.1 → ^3.1.2 (host confusion, path traversal)
- @metamask/sdk + @metamask/sdk-communication-layer <0.33.1 → ^0.33.1
  (malicious [email protected] transitive)
- ip-address <=10.1.0 → ^10.1.1 (XSS in Address6 HTML)
- picomatch >=4 <4.0.4 → ^4.0.4 (method injection)
- follow-redirects <=1.15.11 → ^1.16.0 (auth header leakage)
- postcss <8.5.10 → ^8.5.10 (XSS via unescaped </style>)

vitest 4 compatibility fixes:
- vitest.config.ts: remove deprecated test.poolOptions (rolled into top-level
  pool options); add server.fs.allow for sibling openzeppelin-adapters
  checkout so patch-file imports in export tests don't trip vite's fs.deny.
- 5 test files: convert vi.fn(arrow) / vi.fn().mockImplementation(arrow)
  mocks used as constructors into regular function expressions, since
  vitest 4 / tinyspy 4 now use Reflect.construct(impl, args) which throws
  on arrow functions per ES spec.
- generateAndAddAppConfig.test.ts: clear the spy before counting calls
  (previous tests accumulated state since vi.spyOn no longer replaces an
  existing vi.fn cleanly in vitest 4).

Not fixed in this PR (justifications for dismissal in Security tab):
- uuid <11.1.1 (GHSA-w5hq) — CVE only affects v3/v5/v6(buf); our chain
  uses v4(). Forcing ^11 breaks @solana/web3.js peer constraints.
- elliptic 6.6.1 (GHSA-848j) — no upstream patch exists.
- bigint-buffer 1.1.5 (GHSA-3gc7) — no upstream patch; transitive via
  @solana/spl-token.
@pasevin
pasevin requested a review from a team as a code owner June 6, 2026 11:43
@pasevin
pasevin merged commit 8ae6913 into main Jun 6, 2026
13 checks passed
@pasevin
pasevin deleted the chore/dependabot-batch branch June 6, 2026 12:03
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