Togoder security

npm package security report

@vitejs/plugin-react npm package: is it safe?

Risky patterns found that deserve a look.

Needs review Version 6.1.1 Files reviewed 2 Size 29.9 KB Scanned

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.

0
critical
0
high
0
medium
3
low

Findings 3

low

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.

dist/refresh-runtime.js
low

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.

dist/refresh-runtime.js
low

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.

dist/refresh-runtime.js

Files reviewed

FileVerdictWhat 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.

Scanned versions of @vitejs/plugin-react

VersionVerdictFilesScanned
6.1.1 Needs review 2 Oct 6, 2026

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.

Related security reports