# @vitejs/plugin-react@6.1.1 security report (npm)

- Verdict: **Needs review** (risk level: medium)
- Scanned: 2026-10-06T14:13:31.000Z
- Files reviewed: 2
- Findings: 3 low severity findings
- Report: https://security.togoder.click/npm/@vitejs/plugin-react
- Source: Togoder Security (https://security.togoder.click), AI source-code review

## Summary

Togoder Security scanned the npm package @vitejs/plugin-react@6.1.1 on Oct 6, 2026. An AI review of 2 source files produced 3 low severity findings. The overall verdict is medium: the findings flag risky but common patterns (dynamic code, unsafe defaults, broad file or network access) rather than confirmed malware.

## Findings

### [low] Dynamic import with computed input

Finding ID: `NPS-692872F376EC`

File: `dist/refresh-runtime.js`

The exported function `__hmr_import` performs `import(/* @vite-ignore */ module)` where `module` is a parameter that can be any value, enabling dynamic module loading based on external input. While this is intended for HMR integration with Vite, it could be abused if the module path is attacker-controlled.

### [low] Global window object mutation

Finding ID: `NPS-36C469B7DC2E`

File: `dist/refresh-runtime.js`

The code assigns `window.__registerBeforePerformReactRefresh` and reads `window.__getReactRefreshIgnoredExports`, modifying and relying on global state on the `window` object. This could interfere with other scripts or be leveraged if those globals are set by untrusted code.

### [low] Monkeypatching global hook

Finding ID: `NPS-A2CC7DB07ADF`

File: `dist/refresh-runtime.js`

`injectIntoGlobalHook` replaces `hook.inject`, `hook.onCommitFiberRoot`, and `hook.onScheduleFiberRoot` on the global `__REACT_DEVTOOLS_GLOBAL_HOOK__`. While this is the intended behavior of React Refresh, it constitutes modification of a shared global object, which can be a security concern in untrusted environments.

## Files reviewed

- `dist/refresh-runtime.js` (medium): No data exfiltration, credential harvesting, obfuscation, or shell execution was found; the code is the legitimate React Refresh runtime with only minor concerns around dynamic import and global state mutation.
- `dist/index.js` (safe): No malicious patterns detected; the code is a legitimate Vite React plugin with expected build-tool behavior and no data exfiltration, credential harvesting, obfuscation, or backdoors.

AI analysis is guidance, not a guarantee. Methodology: https://security.togoder.click/methodology
