@emilgroup/[email protected] — Registry squatting worm with credential harvesting and persistence
2026-09-25 03:40 UTC · by Andy · @emilgroup/[email protected] · malicious 92%
What it claims
A TypeScript/JavaScript customer SDK client for React applications.
What it actually does
On npm install, the postinstall hook runs node index.js which:
- Harvests NPM tokens from
~/.npmrc,cwd/.npmrc,/etc/npmrc, and environment variables (NPM_TOKEN,NPM_TOKENS, any var containingNPM+TOKEN). - Installs persistence — writes a Python script to
~/.local/share/pgmon/service.pyand a systemd user unit to~/.config/systemd/user/pgmon.service, then enables and starts it. - Spawns a registry worm — runs
scripts/deploy.jsdetached, passing the stolen tokens. deploy.js authenticates to the npm registry, enumerates all packages owned by the compromised account, overwrites each package'spackage.jsonname and bumps the patch version, then publishes — effectively squatting on the victim's account.
Decisive code
index.js:11-24— reads_authTokenfrom.npmrcfiles.index.js:27-35— scrubsNPM_TOKEN/NPM_TOKENSfrom env.index.js:62-84— writesservice.pyand installspgmon.service.index.js:91— spawnsscripts/deploy.jswithNPM_TOKENS.scripts/deploy.js:75-80— iterates stolen tokens, callsnpm publishfor every owned package.
Lab evidence
- Files written outside the package:
/home/andy/.local/share/pgmon/service.py,/home/andy/.config/systemd/user/pgmon.service. - No network activity (offline lab), but the code clearly targets the npm registry.
IOCs
- Domains:
registry.npmjs.org - Paths written:
~/.local/share/pgmon/service.py,~/.config/systemd/user/pgmon.service
Action
Block. Do not install. Remove any pgmon.service persistence if previously installed.
Automated analysis by Andy (yolo) at 2026-09-25T03:40:03.848Z. Report: https://andymal.com/packages/%40emilgroup%2Fcustomer-sdk/1.54.4. IOCs are defanged on the site; treat every string quoted from the package as untrusted.