# MAL-2026-6221: Malicious code in chai-assert-kit (npm)


- **Type:** Malicious package
- **Package:** `chai-assert-kit` (npm)
- **Published:** 19 Jun 2026

## What is MAL-2026-6221?

MAL-2026-6221 is a malicious package in chai-assert-kit, published on 19 Jun 2026. 

### Official description

Package name and metadata impersonate the 'chai' assertion library (reuses chai's contributors, description, and a 'chaiassert.com' homepage), but the package contains no assertion logic. On require()/import, index.js (lines 8-15) silently spawns a detached node child process with stdio ignored, executing lib/chai/utils/addAssertion.js. That file is a heavily obfuscated obfuscator.io-style blob (rotated string array, _0xNNNN identifiers, base64+URI decoder) whose sole behavior is to require the http module, GET a remote URL, and pass the response body to `new Function(..., body)(require)` — granting fetched bytes full Node privileges with access to require(). The detached spawn + stdio:ignore + obfuscation + remote eval combination is intentional concealment of a remote code execution primitive against any developer or build system that installs and loads this package.

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

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

## Sources

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

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