{"id":"MAL-2025-4029","summary":"Malicious code in ts-runtime-compat-check (npm)","details":"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:\n\n1. Contains a `postinstall` script that executes `lib/install.js`\n\n2. 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)\n\n3. Sends the victim's application path as a query parameter to the malicious server\n\n4. When the server returns specially crafted error messages, the package decodes them from base64 and executes them using `new Function.constructor()`\n\n5. This creates a direct remote code execution capability\n\nThis 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.\n\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: ghsa-malware (1dfc8edb1a3ebdf6a94dd7c031b9535b886f14801458f2251b6783fe4feea5ea)\nAny 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.\n","aliases":["GHSA-hwqw-3w9q-499j"],"modified":"2025-05-28T07:19:33Z","published":"2025-05-17T06:38:42Z","database_specific":{"malicious-packages-origins":[{"id":"GHSA-hwqw-3w9q-499j","import_time":"2025-05-20T00:38:32.990227481Z","modified_time":"2025-05-19T05:55:42Z","ranges":[{"events":[{"introduced":"0"}],"type":"SEMVER"}],"sha256":"1dfc8edb1a3ebdf6a94dd7c031b9535b886f14801458f2251b6783fe4feea5ea","source":"ghsa-malware"}]},"references":[{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-hwqw-3w9q-499j"}],"affected":[{"package":{"name":"ts-runtime-compat-check","ecosystem":"npm","purl":"pkg:npm/ts-runtime-compat-check"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]},{"type":"SEMVER","events":[{"introduced":"0.0.0"}]}],"database_specific":{"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/ts-runtime-compat-check/MAL-2025-4029.json","cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}]}}],"schema_version":"1.7.3","credits":[{"name":"Safedep","contact":["https://safedep.io/"],"type":"FINDER"}]}