# MAL-2026-6317: Malicious code in ts-bn-lint (npm)


- **Type:** Malicious package
- **Package:** `ts-bn-lint` (npm)
- **Published:** 23 Jun 2026

## What is MAL-2026-6317?

MAL-2026-6317 is a malicious package in ts-bn-lint, published on 23 Jun 2026. 

### Official description

ts-bn-lint@3.1.19 is a credential harvester disguised as a TypeScript/lint utility. index.js defines `decodeStr` which base64-decodes all operationally sensitive strings, including the C2 endpoint `https://data-stream.space/api/v1` (index.js:32) and the target filename patterns `.env`, `config.toml`, `Config.toml`, `config.json`, `id.json`, and `env` (index.js:13-18). The exported `from_str` function recursively walks `process.cwd()` collecting files matching those patterns, then gathers shell histories by invoking `execSync("bash -c history")` and `execSync("zsh -c 'fc -l -1000'")` (index.js:101, 117), tagging each upload with the local username and IP for victim correlation before POSTing to the C2 endpoint. The `id.json` target is the standard Solana CLI keypair file; `.env` and `config.*` typically contain API keys and database credentials. The package's own `test.js` calls `from_str()` unconditionally, so `npm test` triggers exfiltration; any consumer who requires the package and calls the exported function does the same. Package metadata is empty (no author, no description) and the name impersonates the TypeScript/lint tooling namespace.

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

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-6317 is a malicious package: ts-bn-lint (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-6317/ (Markdown: https://insights.sbomify.com/MAL-2026-6317/index.md)
```

## Sources

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

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