Malicious code in vitest-preview-pro-all (npm)
The npm package vitest-preview-pro-all contained malicious code that executed arbitrary remote code during installation. A postinstall script spawned obfuscated Node processes that fetched and executed attacker-controlled payloads from jsonbin.io, granting full Node.js capabilities to the attacker.
- Disclosed
- Last updated
- Blast radius
- All npm users who installed vitest-preview-pro-all
- Ecosystems
- Attack vectors
- Affected entities
- vitest-preview-pro-allMalicious npm package impersonating nodemailer
The npm package vitest-preview-pro-all was published with malicious code designed to execute during installation. The package's package.json contained a postinstall hook that ran lib/utils/index.js, which spawned a detached Node child process executing lib/utils/smtp-connection/index.js.
The malicious code was heavily obfuscated using obfuscator.io-style techniques, hiding hex-identifier string arrays. The obfuscated payload performed an axios GET request to https://api.jsonbin.io/v3/b/6a719632da38895dfeb7128d and executed the fetched data via new Function('require', data.record.message)(require), achieving arbitrary remote code execution (RCE) on the installer's machine with full Node.js capabilities.
The package impersonated the legitimate nodemailer library (authored by Andris Reinman) as a cover for the malicious dropper. The jsonbin.io endpoint is mutable and attacker-controlled, with no pinning, hashing, or signing of the fetched payload, allowing the attacker to modify the payload at any time.
This incident was identified and credited to the OpenSSF's malicious-packages repository.
Indicators of compromise
- Packages
- vitest-preview-pro-all
- Domains
- api.jsonbin.io
Remediation
- Immediately uninstall vitest-preview-pro-all from all systems
- Audit npm install logs and process history for any suspicious activity during the installation window
- Review and rotate any credentials or secrets that may have been exposed on affected machines
- Check for any unauthorized modifications to source code, configuration files, or deployed artifacts
- Monitor affected systems for signs of compromise or data exfiltration
- Use npm audit to identify any other malicious packages in your dependency tree
Sources
- GitHub Advisory GHSA-33rq-3xv3-q5cx · GitHub Advisory Database
Cite this entry
"Malicious code in vitest-preview-pro-all (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 6, 2026; last updated August 7, 2026. https://supplychainattack.org/incident/malicious-code-in-vitest-preview-pro-all-npm-di82m5
Suggest a correction
Found an error or have a newer source? Corrections to factual errors take priority over new entries.
Related incidents
- containedcritical
Malware in svelte-dim-kit
The npm package svelte-dim-kit was found to contain malware, potentially giving attackers full control of affected systems. All systems with this package installed should be considered compromised and secrets/keys rotated immediately from a different computer.
npmCompromised package - containedcritical
Malicious code in @syncraft-labs/react (npm)
The npm package @syncraft-labs/react contained obfuscated malicious code in its ESM distribution that implements the EtherHiding pattern, fetching and executing arbitrary code from an Ethereum smart contract via RPC endpoints. The tampering occurred post-build in the dist/index.js artifact.
npmCompromised package - containedcritical
Malicious code in stillm4ddpocs-demo-sprocket (npm)
The npm package stillm4ddpocs-demo-sprocket version 999.9.12 contains malicious code that exfiltrates system and project metadata via multiple channels (HTTPS, HTTP, and DNS) to a hardcoded callback host. The package uses a high version number to exploit dependency-confusion attacks against organizations with internal packages of the same name.
npmCompromised packageDependency confusion - resolvedcritical
Malicious code in stillm4ddpocs-rtest-bravo (npm)
The npm package stillm4ddpocs-rtest-bravo contained malicious code in its preinstall script that automatically executed during installation, collecting system information and internal package metadata and exfiltrating it to a third-party Interactsh collector via HTTPS and DNS tunneling.
npmCompromised package