# Risk map — jestjs/jest

> Canonical page: https://codevetter.com/unpack/jest/risk-map

# Risk map — jestjs/jest

Scanned commit 61050e9323e742539dc2360236671110e37329e6 (2026-10-02). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The following risks are source observations and maintenance limits, not confirmed vulnerabilities. Jest deliberately executes project code and extensibility modules, so configuration and snapshot inputs carry executable authority. Filesystem outputs and worker execution cross the repository-root boundary. Source comments and tests expose specific cache, validation, and ownership limitations without establishing their frequency in practice.
- getSnapshotData executes snapshot contents with new Function('exports', snapshotContents) before header validation and swallows evaluation errors; snapshot files must therefore be treated as executable trusted project inputs. — [packages/jest-snapshot-utils/src/utils.ts#L133-L164](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-snapshot-utils/src/utils.ts#L133-L164)
- Configuration files can execute modules or async exported functions, and orchestration loads custom filter/reporting modules; these paths run before or outside individual test bodies. — [packages/jest-config/src/readConfigFileAndSetRootDir.ts#L89-L114](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-config/src/readConfigFileAndSetRootDir.ts#L89-L114) [packages/jest-core/src/cli/index.ts#L190-L217](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-core/src/cli/index.ts#L190-L217) [packages/jest-core/src/TestScheduler.ts#L433-L443](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-core/src/TestScheduler.ts#L433-L443)
- --clearCache recursively removes configured cache directories, outputFile resolves against cwd and is written directly, and inline snapshots rewrite paths derived from captured stack frames; these operations are not confined by a repository-root check in the inspected functions. — [packages/jest-core/src/cli/index.ts#L67-L77](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-core/src/cli/index.ts#L67-L77) [packages/jest-core/src/runJest.ts#L197-L205](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-core/src/runJest.ts#L197-L205) [packages/jest-snapshot/src/State.ts#L167-L184](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-snapshot/src/State.ts#L167-L184) [packages/jest-snapshot/src/InlineSnapshots.ts#L88-L118](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-snapshot/src/InlineSnapshots.ts#L88-L118)
- The VM environment is not a complete security boundary: CjsLoader routes core modules through CoreModuleProvider and loads .node files with native require, while runTest wraps process.exit for diagnostics and still calls the real exit. — [packages/jest-runtime/src/internals/CjsLoader.ts#L83-L85](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-runtime/src/internals/CjsLoader.ts#L83-L85) [packages/jest-runtime/src/internals/CjsLoader.ts#L293-L300](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-runtime/src/internals/CjsLoader.ts#L293-L300) [packages/jest-runner/src/runTest.ts#L244-L268](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-runner/src/runTest.ts#L244-L268)
- Changed-file detection launches Git subprocesses with project cwd and argument arrays; parallel runners cross process/thread boundaries with serialized configuration and module maps and can force workers to exit during cleanup. — [packages/jest-changed-files/src/git.ts#L13-L22](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-changed-files/src/git.ts#L13-L22) [packages/jest-changed-files/src/git.ts#L47-L75](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-changed-files/src/git.ts#L47-L75) [packages/jest-runner/src/index.ts#L97-L122](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-runner/src/index.ts#L97-L122) [packages/jest-runner/src/index.ts#L184-L198](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-runner/src/index.ts#L184-L198)
- ScriptTransformer explicitly documents that independently cached code and source maps can become mismatched under concurrent writes; code checksums and atomic writes protect code artifacts but do not establish code/map pairing. — [packages/jest-transform/src/ScriptTransformer.ts#L514-L527](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-transform/src/ScriptTransformer.ts#L514-L527) [packages/jest-transform/src/ScriptTransformer.ts#L949-L981](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-transform/src/ScriptTransformer.ts#L949-L981)
- Snapshot ownership has known compatibility limits: clear() without identity does not roll back file data or unchecked keys, and keys using ': ' cannot distinguish a hint from a longer test name, potentially retaining obsolete snapshots. — [packages/jest-snapshot/src/State.ts#L235-L248](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-snapshot/src/State.ts#L235-L248) [packages/jest-snapshot/src/State.ts#L135-L143](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-snapshot/src/State.ts#L135-L143) [packages/jest-snapshot/src/__tests__/State.test.ts#L268-L276](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-snapshot/src/__tests__/State.test.ts#L268-L276)
- Configuration normalization validates before preset merging, with a TODO stating preset-contributed options escape that validation; multiple projects without explicit --config also inherit global settings from the first project's configuration as a documented compatibility fallback. — [packages/jest-config/src/normalize.ts#L546-L575](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-config/src/normalize.ts#L546-L575) [packages/jest-config/src/index.ts#L488-L495](https://github.com/jestjs/jest/blob/61050e9323e742539dc2360236671110e37329e6/packages/jest-config/src/index.ts#L488-L495)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
