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 3
Dynamic import with computed input
NPS-692872F376EC
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.
Global window object mutation
NPS-36C469B7DC2E
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.
Monkeypatching global hook
NPS-A2CC7DB07ADF
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
| File | Verdict | What the reviewer saw |
|---|---|---|
| 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. |
Frequently asked questions
Is @vitejs/plugin-react safe to use?
No confirmed malware was found in @vitejs/plugin-react@6.1.1, but the review flagged 3 low severity findings for risky patterns worth checking before you rely on it.
Does @vitejs/plugin-react contain malware?
No malware was identified in @vitejs/plugin-react@6.1.1 when Togoder Security scanned it on Oct 6, 2026. A new version can still introduce malicious code, so scan the exact versions in your lockfile.
How was @vitejs/plugin-react checked?
Togoder Security downloaded the published npm package and had an AI model read its 2 source files, looking for install scripts, credential access, network exfiltration, obfuscation, backdoors and crypto-wallet theft. The results are cached by file hash and shown here.
How do I scan @vitejs/plugin-react together with the rest of my dependencies?
Upload your lockfile at https://security.togoder.click/scan or call the API documented at https://security.togoder.click/api-docs. Files that have already been scanned, like the ones in @vitejs/plugin-react@6.1.1, cost nothing.