Skip to content

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

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

GioDavid wants to merge 4 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.

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).
- Drop Node 21 and 23 from the CI matrix; Vitest 4 / Vite 8 require
  Node ^20.19 || >=22.12.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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 5, 2026 11:27
Node 21 is end-of-life. It was the only matrix version that needed Vite 7:
Vite 8's bundler (Rolldown) calls util.styleText() with an array of
styles, which Node 21 does not support. With Node 21 gone, remove the
`vite` resolution so Vitest uses Vite 8 again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Node 20 reached end-of-life on 2026-04-30 and Node 23 in June 2025.
Vitest 5 already requires Node ^22.12 || ^24 || >=26, so keeping Node 20
would block the next Vitest upgrade. Node 26 will be added separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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