# MAL-2026-12004: Malicious code in vitest-preview-pro (npm)


- **Type:** Malicious package
- **Package:** `vitest-preview-pro` (npm)
- **Published:** 4 Aug 2026
- **Also known as:** GHSA-wx22-xm6j-mgqx

## What is MAL-2026-12004?

MAL-2026-12004 is a malicious package in vitest-preview-pro, published on 4 Aug 2026. 

### Official description

The package is published under a name suggesting a Vitest preview utility, but the shipped code is a rebranded copy of nodemailer with an added preinstall dropper. package.json declares `preinstall: node lib/utils/index.js`, which uses child_process.spawn(process.execPath, [lib/utils/smtp-connection/index.js], {detached:true, stdio:['ignore','ignore','ignore']}).unref() to launch a detached, fully silenced child that survives beyond `npm install`. The spawned file is obfuscated with a custom basE91 string-array decoder; the decoded top-level async IIFE calls globalThis.fetch against a URL on api.jsonbin.io/v3/, parses the JSON response, and passes the `record.cookie` field to new Function('require', body)(require), executing attacker-controlled JavaScript with full `require` access on the installer at install time. api.jsonbin.io is a public, mutable, anonymous JSON-hosting service, so the executed payload can change at any time. Adjacent to the loader, lib/utils/smtp-connection/LICENSE is a 262KB file whose contents are a hex-encoded ~131KB opaque binary blob rather than license text, colocated with the loader as a staged secondary payload. The advertised package purpose has no relationship to the shipped SMTP source, providing cover for the injected dropper.

Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.

## What should I do about MAL-2026-12004?

Remove the package from your dependencies and lockfiles, then rotate any secrets on machines where it was installed.

## Fix prompt for AI coding agents

```text
MAL-2026-12004 is a malicious package: vitest-preview-pro (npm). Every version was published to cause harm.

Task:
1. Search this repository's dependency manifests and lockfiles for the package, including transitive dependencies.
2. If it is present, remove it, regenerate the lockfile with the project's package manager, and replace whatever it was used for.
3. List any CI runners, developer machines or containers that installed it, so their secrets can be rotated.
4. If the package is not used anywhere, say so and change nothing.

Reference: https://insights.sbomify.com/MAL-2026-12004/ (Markdown: https://insights.sbomify.com/MAL-2026-12004/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/MAL-2026-12004

---
From sbomify Insights: https://insights.sbomify.com/MAL-2026-12004/
Summaries are generated and may contain mistakes; the official description above is the record.
