Malicious code in commandor-lib (npm)
The npm package commandor-lib contained malicious code in its postinstall script that executed on installation, spawning subprocesses and exfiltrating data via HTTP POST requests to an external endpoint. The package was identified by Amazon Inspector and OpenSSF as malicious.
- Disclosed
- Last updated
- Blast radius
- All npm users who installed affected versions of commandor-lib
- Ecosystems
- Attack vectors
- Affected entities
- commandor-libnpm package containing malicious postinstall script
The npm package commandor-lib was found to contain malicious code embedded in scripts/postinstall.js. This script executes automatically when the package is installed via npm.\n\nThe malicious script imports Node.js modules for subprocess execution (child_process) and HTTP requests (http.request), with multiple POST call sites identified at lines 13, 95, and 194. This pattern is consistent with reconnaissance and data exfiltration to an attacker-controlled server at install time.\n\nThe behavior does not correspond to any documented legitimate purpose of a generically named library package. The malicious package was identified through analysis by Amazon Inspector and credited to the OpenSSF malicious-packages repository.\n\nUsers who installed affected versions of commandor-lib during the window of availability are at risk of system compromise and data exfiltration.
Indicators of compromise
- Packages
- commandor-lib
Remediation
- Immediately uninstall commandor-lib from all systems
- Audit npm install logs to identify when commandor-lib was installed
- Assume systems that installed commandor-lib are compromised; perform forensic analysis and credential rotation
- Review outbound network connections from affected systems during the installation window
- Update npm dependencies to remove commandor-lib and use legitimate alternatives
- Consider using npm audit and supply chain security tools to detect similar malicious packages
Sources
- GitHub Advisory GHSA-7p4q-gpmh-m2v5 · GitHub Advisory Database
Cite this entry
"Malicious code in commandor-lib (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 19, 2026; last updated August 19, 2026. https://supplychainattack.org/incident/malicious-code-in-commandor-lib-npm-3ra3z1
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 3-buildsight-web (npm)
The npm package 3-buildsight-web contains malicious code that fetches and executes arbitrary JavaScript from a remote Bitbucket URL on module load, granting full page privileges to an unverified third party.
npmCompromised package - resolvedcritical
Malicious code in @usaa-grp-personal-profile/personal-profile-common (npm)
Malicious package @usaa-grp-personal-profile/personal-profile-common version 999.0.0 published to public npm as a dependency-confusion attack targeting an organization's internal registry. The package contains preinstall and postinstall hooks that exfiltrate hostname, username, and working directory to an attacker-controlled OAST endpoint on every install.
npmDependency confusionCompromised package - resolvedcritical
Malicious code in create-coin (npm)
create-coin@20.1.1 on npm contained malicious postinstall code that collected sensitive environment variables, credentials, and host reconnaissance data. The package impersonated an esbuild platform build and exfiltrated data to a hardcoded endpoint.
npmCompromised packageTyposquatting - resolvedcritical
Malicious code in @syncraft-labs/vue (npm)
The npm package @syncraft-labs/vue version 0.4.1 contained malicious obfuscated code in its ESM build that implements a blockchain-hosted C2 dropper (EtherHiding pattern), enabling remote code execution on any consumer importing the package.
npmCompromised package