Malicious pgserve npm Releases Harvest Credentials and Spread to Other Packages

· Original article ↗

Summary

StepSecurity reports that pgserve versions 1.1.11–1.1.13 added a credential-stealing postinstall script with npm and PyPI propagation. In a controlled run, it observed encrypted data exfiltration to an ICP canister; 1.1.10 was the last legitimate release.

Key points

  • StepSecurity identifies pgserve versions 1.1.11, 1.1.12 and 1.1.13, published April 21, 2026, as compromised; it identifies 1.1.10 as the last legitimate release.
  • The releases added scripts/check-env.js and scripts/public.pem and changed the package postinstall hook to run the script automatically.
  • The script scans environment variables and developer files for credentials, including cloud, npm, SSH, wallet and browser-password data, then encrypts collected data with AES-256 and an RSA-4096 public key.
  • StepSecurity says the malware can use discovered npm publish tokens to infect and publish modified packages, and PyPI tokens to spread through .pth file injection.
  • In a controlled GitHub Actions run, StepSecurity observed 38 matching environment variables and successful encrypted exfiltration to cjn37-uyaaa-aaaac-qgnva-cai[.]raw[.]icp0[.]io; no npm token was found, so propagation did not occur in that run.
  • Harden-Runner captured and blocked connections to the ICP canister and telemetry[.]api-monitor[.]com after the domains were added to its global block list.
  • StepSecurity says it disclosed the issue to the maintainer and added the indicators to its block list.

Article Details

Attack Vectors
  • Compromised pgserve versions 1.1.11, 1.1.12, and 1.1.13 execute credential-harvesting code through an npm postinstall hook.
  • The malware scans environment variables and developer credential files, including package-manager tokens, cloud credentials, SSH keys, crypto-wallet data, and Chrome saved passwords.
  • If it finds an npm publish token, the malware modifies and publishes packages the victim can publish, adding its script and postinstall hook.
  • If it finds a PyPI token, the malware spreads to Python packages using .pth file injection.
Defensive Notes
  • Avoid pgserve versions 1.1.11, 1.1.12, and 1.1.13; the article identifies 1.1.10 and earlier as safe.
  • Block the reported exfiltration endpoints; the article says both were added to the Harden-Runner global block list.

Indicators of compromise

TypeIndicatorContext
URLhxxps[:]//cjn37-uyaaa-aaaac-qgnva-cai[.]raw[.]icp0[.]io/dropReported primary exfiltration endpoint; the article says the malware sent encrypted credential data to this ICP canister.
URLhxxps[:]//telemetry[.]api-monitor[.]com/v1/telemetryReported secondary webhook exfiltration endpoint, used when the TEL_SIGN_KEY environment variable is set.

MITRE ATT&CK

Vendors

Products

Tools

Related Articles