Socket Finds CanisterWorm-Style Malware in Namastex-Linked npm Packages

Summary
Socket reports malicious npm packages linked to Namastex’s Automagik ecosystem that steal developer secrets, browser and wallet data, and attempt propagation across npm and PyPI. The upstream cause remains unresolved.
Key points
- Malicious postinstall payloads were identified in @automagik/genie versions 4.260421.33–4.260421.39 and pgserve versions 1.1.11–1.1.13, as well as releases from @fairwords and @openwebconcept.
- The malware targets environment variables and files containing npm, SSH, cloud, Kubernetes, Docker, infrastructure, and other credentials, plus browser login data and crypto-wallet artifacts.
- Stolen data is sent to an HTTPS webhook and an Internet Computer canister; the payload can encrypt data with AES-256-CBC and RSA-OAEP-SHA256 when a public key is available.
- The malware attempts to use stolen npm tokens to inject postinstall hooks into publishable packages and republish them, and includes PyPI propagation logic using Python .pth files and Twine.
- Socket reports strong overlap with prior CanisterWorm and TeamPCP-style activity, including a code reference to a TeamPCP/LiteLLM method; the canister differs from the previously documented one, and the upstream cause remains unresolved.
- Recommended response includes removing affected versions, rotating potentially exposed credentials, reviewing package publish histories, hunting for the listed indicators, and comparing npm tarballs with public GitHub tags.
Article Details
- Attack Vectors
- Compromised npm packages execute malicious JavaScript through install-time postinstall hooks.
- The payload collects secrets from environment variables and local files, including npm credentials, SSH material, cloud credentials, and .env files; it also targets browser and cryptocurrency-wallet artifacts.
- Stolen data is exfiltrated through HTTPS webhook endpoints and an Internet Computer canister endpoint, with optional AES-256-CBC and RSA-OAEP-SHA256 encryption.
- The malware attempts to propagate by using stolen npm publishing credentials to modify and republish packages, and by creating Python .pth payloads and uploading packages to PyPI with Twine.
- Defensive Notes
- Treat the identified affected package versions as malicious; block and remove them from development and CI/CD environments.
- Rotate npm and GitHub tokens, cloud credentials, SSH keys, and other secrets available on systems where affected packages were installed.
- Review package publishing histories and hunt internal mirrors, artifact caches, and repository history for the reported indicators and malicious postinstall patterns.
- Compare npm-published tarballs with public GitHub tags and release artifacts to identify release mismatches.
Indicators of compromise
| Type | Indicator | Context |
|---|---|---|
| SHA256 | 834b6e5db5710b9308d0598978a0148a9dc832361f1fa0b7ad4343dcceba2812 | SHA-256 hash of the embedded public key file dist/public.pem found in compromised packages. |
| SHA256 | 87259b0d1d017ad8b8daa7c177c2d9f0940e457f8dd1ab3abab3681e433ca88e | DER SHA-256 fingerprint of the public key embedded in the malicious payload, identified as a hunt pivot. |
| SHA256 | c19c4574d09e60636425f9555d3b63e8cb5c9d63ceb1c982c35e5a310c97a839 | SHA-256 hash of the malicious distributed file dist/env-compat.cjs. |
| URL | hxxps[:]//telemetry[.]api-monitor[.]com/v1/drop | Malware HTTPS webhook endpoint used to exfiltrate stolen data. |
| URL | hxxps[:]//telemetry[.]api-monitor[.]com/v1/telemetry | Malware HTTPS webhook endpoint used to exfiltrate stolen data. |
MITRE ATT&CK
T1005 · Data from Local SystemThe malware reads local files such as .npmrc, SSH keys, .git-credentials, cloud credentials, and shell history.T1059 · Command and Scripting InterpreterMalicious JavaScript runs through package postinstall hooks during installation.T1071 · Application Layer ProtocolThe malware uses HTTPS requests to communicate with its webhook and canister endpoints.T1195 · Supply Chain CompromiseThe attacker injects postinstall hooks into compromised npm packages and attempts to republish packages using stolen publishing credentials.T1546 · Event Triggered ExecutionThe payload creates Python .pth files that execute when Python starts, supporting propagation.T1552.001 · Credentials In FilesThe malware harvests credentials and tokens from local files and matching environment variables.T1555 · Credentials from Password StoresThe payload targets Chrome login storage and browser extension data associated with MetaMask and Phantom.T1567 · Exfiltration Over Web ServiceStolen data is sent to an HTTPS webhook and an Internet Computer canister endpoint.
Threat Actors
Products
@automagik/genieCompromised packages include @automagik/genie (versions 4.260421.33–4.260421.39) and pgserve (1.1.11–1.1.13), plus sibling compromises observed in @fairwords and @openwebconcept packages, suggesting shared malwarepgserveCompromised packages include @automagik/genie (versions 4.260421.33–4.260421.39) and pgserve (1.1.11–1.1.13), plus sibling compromises observed in @fairwords and @openwebconcept packages, suggesting shared malware
