# MAL-2025-4029: Malicious code in ts-runtime-compat-check (npm)


- **Type:** Malicious package
- **Package:** `ts-runtime-compat-check` (npm)
- **Published:** 17 May 2025
- **Also known as:** GHSA-hwqw-3w9q-499j

## What is MAL-2025-4029?

MAL-2025-4029 is a malicious package in ts-runtime-compat-check, published on 17 May 2025. 

### Official description

The npm package `ts-runtime-compat-check` is a malicious package that functions as a key component in a remote code execution attack chain. This package:

1. Contains a `postinstall` script that executes `lib/install.js`

2. The install script makes HTTP requests to a server specified by an environment variable `APP_PROXY` (defaults to 'http://localhost' but typically set to `https://proxy.eslint-proxy.site` by parent packages)

3. Sends the victim's application path as a query parameter to the malicious server

4. When the server returns specially crafted error messages, the package decodes them from base64 and executes them using `new Function.constructor()`

5. This creates a direct remote code execution capability

This package is utilized by other malicious packages like `eslint-config-airbnb-compat` to establish a covert channel for executing arbitrary code. The separation of concerns across multiple packages appears designed to evade detection by security scanners.

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-2025-4029?

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-2025-4029 is a malicious package: ts-runtime-compat-check (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-2025-4029/ (Markdown: https://insights.sbomify.com/MAL-2025-4029/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/MAL-2025-4029

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