Supply chain · npm · High

Critical Malicious npm Package: 'vitest-preview-pro-all' Enables Remote Code Execution

Threat Engine Auto-Feed · data current as of 2026-08-06

The npm package 'vitest-preview-pro-all' version 10.0.3 contains malicious code that executes arbitrary remote code during installation. This package impersonates the 'nodemailer' library, allowing an attacker to achieve full Node capability on the installer's machine. Organizations using this package are at high risk of supply chain compromise.

  • Package: npm / vitest-preview-pro-all
  • Affected versions: = 10.0.3
  • Severity: critical
  • Reach: ~0/wk
  • Exposure: 60/100 (High)

What happened — Malicious package

The npm package 'vitest-preview-pro-all' version 10.0.3 was found to contain malicious code. During the package's postinstall script, a detached Node child process is spawned, executing an obfuscated script. This script fetches a payload from an attacker-controlled, mutable third-party host (api.jsonbin.io) and then executes it using `new Function('require', data.record.message)(require)`, granting full Node capabilities.

How the attack works

This is a malicious package attack where an attacker publishes a seemingly legitimate or impersonated package to a public registry. When a developer or automated system installs this package, a script embedded within the package's lifecycle hooks (e.g., `postinstall`) is automatically executed. This script then acts as a dropper, fetching and executing additional arbitrary code from a remote server, leading to compromise of the installation environment.

Who's exposed

Profiles most at risk

  • Development teams using the npm ecosystem
  • CI/CD pipelines that pull dependencies directly from npm
  • Organizations with build systems that install 'vitest-preview-pro-all' version 10.0.3

Conditions that increase exposure

  • Unpinned or broad dependency ranges that allow pulling the malicious version
  • Lack of lockfiles (e.g., `package-lock.json`) to ensure consistent dependency versions
  • Internal package mirrors that do not vet incoming packages for malicious content
  • Automated systems that install new or updated dependencies without review

Blast-radius scenarios

  • An attacker achieves arbitrary remote code execution on the machine where the package is installed, with full Node capabilities.
  • Compromised build environments, leading to potential injection of malicious code into downstream artifacts.
  • Exfiltration of sensitive data from developer workstations or CI/CD servers.
  • Establishment of persistent access to compromised systems.

What to do (defensive)

Detect

  • Scan `package.json` and `package-lock.json` files for direct or transitive dependencies on 'vitest-preview-pro-all' version 10.0.3.
  • Monitor network traffic for connections to `api.jsonbin.io` from build systems or developer machines.
  • Implement software composition analysis (SCA) tools to identify known malicious packages in your dependency tree.
  • Review `postinstall` scripts and other lifecycle hooks for suspicious or obfuscated code in newly introduced packages.

Contain

  • Immediately quarantine any systems identified as having installed 'vitest-preview-pro-all' version 10.0.3.
  • Block network access to `api.jsonbin.io` from all development and build environments.
  • Remove 'vitest-preview-pro-all' from all `package.json` files and dependency trees.
  • Invalidate and rotate credentials used on any potentially compromised systems.

Remediate

  • Perform a full forensic analysis on any system that installed the malicious package to identify the extent of compromise.
  • Rebuild affected systems from trusted images or known good states.
  • Enforce strict dependency pinning using lockfiles (e.g., `package-lock.json`) to prevent unexpected version updates.
  • Implement a robust package review process for all new or updated third-party dependencies.

Frontier verdict — High

Prioritize immediate detection and removal of 'vitest-preview-pro-all' version 10.0.3 due to critical remote code execution risk.

Sources

For detection-engineering and awareness only · point-in-time · not security advice · sourced from the GitHub Advisory Database.