Skip to content

fix: bump vitest to ^4.1.11 to resolve GHSA-82fw-gwwq-j7x9 - #484

Merged
joe-yeager merged 2 commits into
mainfrom
jyeager_hubspot/fix-dependabot-44
Sep 16, 2026
Merged

joe-yeager merged 2 commits into
mainfrom
jyeager_hubspot/fix-dependabot-44

Conversation

@joe-yeager

Copy link
Copy Markdown
Contributor

Description and Context

  • Bumps vitest from ^3.2.6 to ^4.1.11 (dev dependency) to resolve Dependabot alert #44
  • Advisory GHSA-82fw-gwwq-j7x9 (CVE-2026-84373): path traversal / arbitrary file read via @vitest/mocker's redirect-mock load hook on the dev server's unauthenticated HMR socket
  • Vulnerable range was >= 2.1.0, < 4.1.11; fixed upstream in 4.1.11
  • No lockfile is checked into this repo (.yarnrc sets --install.no-lockfile true), so this package.json range bump is the only change needed

Pre-review checklist

  • yarn build succeeds
  • yarn test — same pre-existing failures as on ^3.2.6 baseline (env-dependent URL assertions unrelated to this change), no new failures
  • yarn eslint --max-warnings=0 . is clean
  • Tests have been added for new behaviors (n/a — dependency bump only)
  • Manually tested the changes

Screenshots

N/A — dependency version bump, no CLI output or visible behavior change.

TODO

None.

Who to Notify

N/A

Fixes Dependabot alert #44 — path traversal / arbitrary file read via
@vitest/mocker's redirect mock in the dev server interceptor plugin.
Vulnerable range was >= 2.1.0, < 4.1.11; fixed upstream in 4.1.11.
camden11
camden11 previously approved these changes Sep 16, 2026
Vitest 4 tightens `new`-call semantics for mocks: mockReturnValue can no
longer stand in for a constructor, and mockImplementation requires a real
(non-arrow) function so Reflect.construct can use it.

- http/__tests__/index.test.ts: switch http/https Agent mocks from
  mockReturnValue to mockImplementation with a regular function.
- lib/__tests__/uploadFolder.test.ts: convert the FieldsJs mock
  implementation from an arrow function to a function expression.
- config/__tests__/config.test.ts: drop a dead mockGetHsSettingsFile
  mockReturnValueOnce call in the getAllConfigAccounts() test —
  getAllConfigAccounts() never reads hs settings, so the queued value
  went unconsumed and leaked into the next describe block, which now
  goes uncleared between tests under vitest 4.
@joe-yeager
joe-yeager merged commit cb4176f into main Sep 16, 2026
1 check 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