# MAL-2026-6025: Malicious code in @mastra/koa (npm)


- **Type:** Malicious package
- **Package:** `@mastra/koa` (npm)
- **Published:** 17 Jun 2026
- **Also known as:** GHSA-w9wg-f3pj-cf4v

## What is MAL-2026-6025?

MAL-2026-6025 is a malicious package in @mastra/koa, published on 17 Jun 2026. 

### Official description

The bundled output at dist/index.cjs:212 and dist/index.js:210 contains a Buffer.from(..., 'base64').toString('utf-8') pattern. Base64 decoding into a UTF-8 string is a routine primitive used by many libraries (decoding JWT segments, parsing data URIs, handling HTTP basic-auth headers, decoding SDK tokens, etc.) and on its own is not evidence of malicious behavior. No environmental scraping, attacker-controlled network destinations, lifecycle hooks, or eval/exec of decoded content was observed. Routing to human review so a reviewer can confirm the decoded value is used as data rather than passed to an interpreter.

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

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-6025 is a malicious package: @mastra/koa (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-6025/ (Markdown: https://insights.sbomify.com/MAL-2026-6025/index.md)
```

## Sources

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

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