MAL-2026-6710: Malicious code in vitest-agent (npm)
The npm package 'vitest-agent' versions 1.0.5 and 1.0.6 contains malicious code that executes automatically during installation. Its postinstall script runs a detached Node.js process that fetches and executes remote JavaScript code, effectively running untrusted code on the installer's machine. The package masquerades as related to the vitest ecosystem but is actually a copy of nodemailer with deceptive naming and file structures to conceal its malicious intent. Installation of this package compromises the host system, potentially exposing all stored secrets and keys.
AI Analysis
Technical Summary
The 'vitest-agent' npm package (versions 1.0.5 and 1.0.6) includes a postinstall lifecycle script that spawns a detached Node.js child process executing code fetched dynamically from a remote URL. This code execution occurs without user interaction beyond installing the package. The package's source code is a verbatim copy of nodemailer but with misleading metadata and file structures designed to disguise its malicious behavior. The malicious payload fetches JavaScript from 'https://jsonkeeper.com/b/WDH3V' and executes it using 'new Function', allowing arbitrary code execution on the installer's machine. This results in a full compromise of any system where the package is installed.
Potential Impact
Systems that install 'vitest-agent' versions 1.0.5 or 1.0.6 are fully compromised as the package executes arbitrary remote code during installation. This can lead to unauthorized access, data theft, and control over the affected machine. All secrets and keys stored on the compromised system should be considered exposed and must be rotated immediately. Removing the package alone may not eliminate all malicious components due to the potential for persistent backdoors or additional malware installed by the malicious code.
Mitigation Recommendations
No official patch or fix is currently available for this malicious package. The recommended mitigation is to immediately remove the 'vitest-agent' package versions 1.0.5 and 1.0.6 from all systems. Treat any system with this package installed as fully compromised. Rotate all secrets, keys, and credentials from a separate, trusted environment. Avoid installing packages from untrusted or suspicious sources and verify package authenticity before installation.
MAL-2026-6710: Malicious code in vitest-agent (npm)
Description
The npm package 'vitest-agent' versions 1.0.5 and 1.0.6 contains malicious code that executes automatically during installation. Its postinstall script runs a detached Node.js process that fetches and executes remote JavaScript code, effectively running untrusted code on the installer's machine. The package masquerades as related to the vitest ecosystem but is actually a copy of nodemailer with deceptive naming and file structures to conceal its malicious intent. Installation of this package compromises the host system, potentially exposing all stored secrets and keys.
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-agent' npm package (versions 1.0.5 and 1.0.6) includes a postinstall lifecycle script that spawns a detached Node.js child process executing code fetched dynamically from a remote URL. This code execution occurs without user interaction beyond installing the package. The package's source code is a verbatim copy of nodemailer but with misleading metadata and file structures designed to disguise its malicious behavior. The malicious payload fetches JavaScript from 'https://jsonkeeper.com/b/WDH3V' and executes it using 'new Function', allowing arbitrary code execution on the installer's machine. This results in a full compromise of any system where the package is installed.
Potential Impact
Systems that install 'vitest-agent' versions 1.0.5 or 1.0.6 are fully compromised as the package executes arbitrary remote code during installation. This can lead to unauthorized access, data theft, and control over the affected machine. All secrets and keys stored on the compromised system should be considered exposed and must be rotated immediately. Removing the package alone may not eliminate all malicious components due to the potential for persistent backdoors or additional malware installed by the malicious code.
Mitigation Recommendations
No official patch or fix is currently available for this malicious package. The recommended mitigation is to immediately remove the 'vitest-agent' package versions 1.0.5 and 1.0.6 from all systems. Treat any system with this package installed as fully compromised. Rotate all secrets, keys, and credentials from a separate, trusted environment. Avoid installing packages from untrusted or suspicious sources and verify package authenticity before installation.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-6710
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-w2r4-4x6j-3h5x"]
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a46ed0327e9c797194451eb
Added to database: 07/02/2026, 22:58:11 UTC
Last enriched: 07/02/2026, 23:31:56 UTC
Last updated: 07/03/2026, 00:51:24 UTC
Views: 4
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.
External Links
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.