Malicious code in vitest-preview-pro (npm)
The npm package 'vitest-preview-pro' versions 10.0.3, 10.0.5, 10.0.6, and 10.0.7 contains malicious code masquerading as a Vitest preview utility. Instead of its advertised functionality, it includes a rebranded nodemailer with a preinstall script that launches a detached, silent child process executing attacker-controlled JavaScript fetched from a public JSON hosting service. This allows arbitrary code execution at install time with full require access. The package also includes a large hex-encoded binary payload disguised as a license file. This malicious behavior enables dynamic payload updates via the public JSON endpoint, posing a significant risk to users who install these versions.
AI Analysis
Technical Summary
The 'vitest-preview-pro' npm package versions 10.0.3, 10.0.5, 10.0.6, and 10.0.7 are malicious. The package contains a preinstall script that runs a detached child process executing obfuscated JavaScript code. This code fetches a JSON payload from api.jsonbin.io, a public and mutable JSON hosting service, and executes the 'record.cookie' field as JavaScript with full require privileges during installation. The package's advertised purpose is a Vitest preview utility, but it actually contains a rebranded nodemailer library with an added dropper. Additionally, a large hex-encoded binary blob is included as a staged secondary payload disguised as a license file. This setup allows attackers to dynamically change the payload delivered to victims at install time.
Potential Impact
Users installing affected versions of 'vitest-preview-pro' are at risk of arbitrary code execution during package installation. The attacker-controlled payload executes with full Node.js require access, enabling potential compromise of the host system, installation of additional malware, data exfiltration, or other malicious activities. The use of a public, mutable JSON hosting service for payload delivery means the malicious code can be updated dynamically, increasing the threat's persistence and adaptability.
Mitigation Recommendations
No official patch or remediation guidance is provided in the available data. Users should immediately avoid installing or using 'vitest-preview-pro' versions 10.0.3, 10.0.5, 10.0.6, and 10.0.7. Remove these versions from any systems where they are installed. Consider auditing your environment for signs of compromise if these versions were used. Monitor official npm advisories or the package maintainer for updates or removal of the malicious package. Until a fix or official guidance is available, do not trust or use this package.
Malicious code in vitest-preview-pro (npm)
Description
The npm package 'vitest-preview-pro' versions 10.0.3, 10.0.5, 10.0.6, and 10.0.7 contains malicious code masquerading as a Vitest preview utility. Instead of its advertised functionality, it includes a rebranded nodemailer with a preinstall script that launches a detached, silent child process executing attacker-controlled JavaScript fetched from a public JSON hosting service. This allows arbitrary code execution at install time with full require access. The package also includes a large hex-encoded binary payload disguised as a license file. This malicious behavior enables dynamic payload updates via the public JSON endpoint, posing a significant risk to users who install these versions.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The 'vitest-preview-pro' npm package versions 10.0.3, 10.0.5, 10.0.6, and 10.0.7 are malicious. The package contains a preinstall script that runs a detached child process executing obfuscated JavaScript code. This code fetches a JSON payload from api.jsonbin.io, a public and mutable JSON hosting service, and executes the 'record.cookie' field as JavaScript with full require privileges during installation. The package's advertised purpose is a Vitest preview utility, but it actually contains a rebranded nodemailer library with an added dropper. Additionally, a large hex-encoded binary blob is included as a staged secondary payload disguised as a license file. This setup allows attackers to dynamically change the payload delivered to victims at install time.
Potential Impact
Users installing affected versions of 'vitest-preview-pro' are at risk of arbitrary code execution during package installation. The attacker-controlled payload executes with full Node.js require access, enabling potential compromise of the host system, installation of additional malware, data exfiltration, or other malicious activities. The use of a public, mutable JSON hosting service for payload delivery means the malicious code can be updated dynamically, increasing the threat's persistence and adaptability.
Mitigation Recommendations
No official patch or remediation guidance is provided in the available data. Users should immediately avoid installing or using 'vitest-preview-pro' versions 10.0.3, 10.0.5, 10.0.6, and 10.0.7. Remove these versions from any systems where they are installed. Consider auditing your environment for signs of compromise if these versions were used. Monitor official npm advisories or the package maintainer for updates or removal of the malicious package. Until a fix or official guidance is available, do not trust or use this package.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-12004
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a75f709bf8831d53984ec70
Added to database: 08/07/2026, 15:17:29 UTC
Last enriched: 08/07/2026, 15:21:02 UTC
Last updated: 08/07/2026, 15:21:02 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.