Skip to content

fix(security): update vitest to 4.1.11 - #255

Open
GioDavid wants to merge 3 commits into
mainfrom
fix/security-vitest-4
Open

GioDavid wants to merge 3 commits into
mainfrom
fix/security-vitest-4

Conversation

@GioDavid

@GioDavid GioDavid commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Upgrading Vitest to 4.1.11: full summary

The problem
GitHub flagged a vulnerability in @vitest/mocker, a package that Vitest installs:

Advisory: "Vitest: Path Traversal / Arbitrary File Read via @vitest/mocker Redirect Mock"
Affected versions: >=2.1.0 <4.1.11
The repo had: vitest@3.2.7, which installs @vitest/mocker@3.2.7. That version is vulnerable.
No 3.x release fixes it, so the only fix is upgrading to Vitest 4.1.11, a new major version.

Vitest is only a dev dependency of package/, used to run the tests. It isn't part of the published library, so people who install react-native-spotlight-tour were never affected. The alert concerns the development environment and CI.

@GioDavid
GioDavid marked this pull request as draft October 2, 2026 21:02
@GioDavid
GioDavid marked this pull request as ready for review October 2, 2026 21:32
@GioDavid
GioDavid requested a review from suany0805 October 2, 2026 21:33
Comment thread package.json Outdated
Comment thread package/vitest.config.mts
@GioDavid
GioDavid requested a review from suany0805 October 2, 2026 22:15
David Proaño and others added 2 commits October 7, 2026 11:16
Node 20 reached end-of-life on 2026-04-30, Node 21 in June 2024 and
Node 23 in June 2025. Keep the supported LTS lines (22 and 24).

This also unblocks the Vitest 4 security upgrade: Vite 8 (installed by
Vitest 4) crashes on Node 21, and Vitest 5 requires Node ^22.12.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the @vitest/mocker path traversal / arbitrary file read advisory
(affects >=2.1.0 <4.1.11).

- Replace the react-native-testing-mocks/vitest plugin with an inline
  config and a local test environment: the plugin's CJS environment is not
  unwrapped by Vitest 4 ("environment.setup is not a function") and relies
  on the removed `transformMode` option.
- Move `poolOptions.forks.execArgv` to `test.execArgv` (`poolOptions` was
  removed in Vitest 4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GioDavid
GioDavid force-pushed the fix/security-vitest-4 branch from 81e5b3a to c9b74fc Compare October 7, 2026 16:20

This branch has not been deployed

No deployments
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