# MAL-2026-6465: Malicious code in chai-as-built (npm)


- **Type:** Malicious package
- **Package:** `chai-as-built` (npm)
- **Published:** 25 Jun 2026

## What is MAL-2026-6465?

MAL-2026-6465 is a malicious package in chai-as-built, published on 25 Jun 2026. 

### Official description

chai-as-built masquerades as the pino logger (package.json keywords 'fast','logger','stream','json'; file layout lib/proto.js, lib/redaction.js, lib/transport.js, lib/multistream.js, lib/levels.js; export `module.exports.pino = middleware`) while its name shadows the popular chai-as-promised. When a consumer imports the package and invokes the exported middleware, index.js spawns a detached `node` child process running lib/initializeCaller.js. That script base64-decodes a hardcoded URL (https://amethyst-lorrin-26.tiiny.site/index.json) hidden inside a fake `process.env` shadow object, GETs the JSON with a custom header, and passes the response's `cookie` field to `new Function.constructor('require', response)`, then invokes the resulting function with `require` — executing arbitrary attacker-supplied JavaScript with full Node privileges. The fetch is retried up to 5 times against a mutable anonymous tiiny.site host with no integrity check. The combination of typosquat/impersonation cover, base64 string concealment of the C2 endpoint, detached child-process execution, and dynamic Function-constructor evaluation of remote content is a textbook supply-chain dropper.

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

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

## Sources

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

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