# MAL-2026-6220: Malicious code in chai-as-uphelded (npm)


- **Type:** Malicious package
- **Package:** `chai-as-uphelded` (npm)
- **Published:** 19 Jun 2026
- **Also known as:** GHSA-9gg4-phm5-h5g9

## What is MAL-2026-6220?

MAL-2026-6220 is a malicious package in chai-as-uphelded, published on 19 Jun 2026. 

### Official description

Package name impersonates the popular `chai-as-promised` library, but its package.json description and keywords masquerade as a pino-style logger and an unrelated vulnerability-management document — a deliberate metadata cover. The default export is an Express-style middleware that, when invoked, spawns a detached `node./lib/caller.js`. caller.js base64-decodes a URL to `https://api.jsonstorage.net/v1/json/2ef8c758-a96f-459e-b036-b3b90379a165/a179ea35-b962-4722-b3f1-e28316d1a44a`, GETs JSON, and passes the response's `cookie` field directly to `new Function.constructor('require', s)(require)` — evaluating attacker-controlled JavaScript with full access to Node's `require`. The endpoint is mutable third-party storage, the URL is obscured via base64, and the executed payload is opaque. Any consumer that uses the package's documented middleware (or runs the package's own smoke script) reaches the eval sink.

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

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

## Sources

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

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