Malicious code in chain-analyze (npm)
The npm package chain-analyze contained malicious code that executed arbitrary Node.js commands on installation. The package impersonated the official Theta blockchain SDK and used a split-package design with a dependency (chain-manager) to hide encrypted payload from scanners.
- Disclosed
- Last updated
- Blast radius
- Any developer or system installing the malicious chain-analyze package from npm; code executes at module load time on the installer's machine.
- Ecosystems
- Attack vectors
- Affected entities
- chain-analyzeMalicious npm package impersonating @thetalabs/theta-js SDK; contains obfuscated executable code in dist bundles
The npm package chain-analyze was published with malicious code embedded in its dist bundle files (dist/sigchain-js.cjs.js, dist/sigchain-js.esm.js, dist/sigchain-js.umd.js). The code executed automatically on module load, reading an encrypted blob from a sibling dependency named 'chain-manager', decrypting it with a hardcoded password, and spawning a detached Node.js child process to execute the decrypted attacker-controlled script.
The package impersonated the official @thetalabs/theta-js SDK by declaring the author as 'Theta Labs' and describing itself as a JavaScript library for the Theta blockchain. The malicious code was present only in the dist/ directory; the src/ tree contained no reference to the attack infrastructure, allowing source reviewers to see a clean codebase while consumers received the tampered build.
The attack used a split-package design: chain-analyze pinned chain-manager ^1.0.9 as a dependency, which supplied the encrypted payload. This design hid the executable code from automated scanners that inspect only a single tarball. The declared main entry point in package.json (dist/chain-analyze.cjs.js) was not shipped; instead, only the malicious dist/sigchain-js.* bundles were published, ensuring consumers resolved to the compromised build.
The incident was identified and credited to the OpenSSF malicious-packages project.
Indicators of compromise
- Packages
- chain-analyze
- chain-manager
Remediation
- Immediately uninstall chain-analyze and chain-manager from all systems and projects
- Audit npm install logs and lock files to identify any systems that installed these packages
- Review and revoke any credentials or secrets that may have been exposed on affected machines
- Verify the integrity of any code or artifacts built or deployed using these packages
- Use npm audit to check for the presence of these packages in dependency trees
- Consider using npm package signing verification and supply chain security tools to detect similar attacks in the future
Sources
- GitHub Advisory GHSA-gqcp-j8hr-w48x · GitHub Advisory Database
Cite this entry
"Malicious code in chain-analyze (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed July 28, 2026; last updated July 28, 2026. https://supplychainattack.org/incident/malicious-code-in-chain-analyze-npm-f4aymb
Suggest a correction
Found an error or have a newer source? Corrections to factual errors take priority over new entries.
Related incidents
- containedcritical
Malicious code in sigchain-js (npm)
Malicious code was injected into the published npm package sigchain-js, executing arbitrary code on installation via DES-decrypted payloads from companion packages thedata and tchain-api. The attack also involved typosquatting axios to version 1.18.1, which does not exist in legitimate release history.
npmCompromised packageDependency confusionTyposquatting - resolvedcritical
Malicious code in rollup-runtime-core-polyfills (npm)
The npm package rollup-runtime-core-polyfills contained malicious code that impersonated a legitimate rollup polyfill plugin. On every import/require, it decoded and executed a shell command to install an attacker-controlled package (svgcraft-core) and executed code from it, affecting any build system that consumed this package.
npmCompromised packageTyposquatting - containedcritical
Malicious code in @ai_/autoprefixers (npm)
@ai_/autoprefixers is a typosquat of the legitimate autoprefixer package that executes arbitrary attacker-controlled shell commands on installation. The malicious code fetches encrypted payloads from remote C2 servers and decrypts them using a hardcoded key suffix before execution via child_process.exec.
npmTyposquattingCompromised package - containedcritical
Malicious code in text-line-parser (npm)
The npm package text-line-parser contained malicious code in its postinstall.js that collected system information, environment variables (including CI tokens and cloud credentials), and exfiltrated them to a Burp Collaborator domain. The package advertised itself as a text-parsing utility but shipped only stub functions, consistent with a typosquat/decoy supply-chain attack.
npmCompromised packageTyposquatting