# MAL-2026-6341: Malicious code in react-check-error (npm)


- **Type:** Malicious package
- **Package:** `react-check-error` (npm)
- **Published:** 23 Jun 2026
- **Also known as:** GHSA-fphr-9c8m-c35g

## What is MAL-2026-6341?

MAL-2026-6341 is a malicious package in react-check-error, published on 23 Jun 2026. 

### Official description

On require(), index.js invokes _initMsgCache() at module top level. The function derives an AES-256-CBC key, IV, and ciphertext from a hardcoded 161-byte array (index.js:62) processed through an LCG-derived sbox, decrypts a URL, performs an https.get to that URL, parses the JSON response, and executes the response's `cookie` field via `new Function('require', mod)(require)` (index.js:155). This is a fully attacker-controlled remote code execution payload that runs on every consumer's machine the moment the package is imported, with full `require` access in the Node process. The package additionally impersonates the legitimate chai utility `check-error` — it copies chai's author metadata, description, the chaijs/check-error repository URL, and the original API surface (compatibleInstance, compatibleConstructor, compatibleMessage, getMessage, getConstructorName), with the dropper grafted onto the genuine sources. Unused runtime dependencies (axios, form-data, socket.io-client) are declared as further cover. The URL obfuscation (byte array + sbox XOR + per-index subtraction + bit rotation + AES-256-CBC) exists solely to hide the C2 endpoint from scanners — legitimate packages do not encrypt their network destinations.

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

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-6341 is a malicious package: react-check-error (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-6341/ (Markdown: https://insights.sbomify.com/MAL-2026-6341/index.md)
```

## Sources

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

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