Self-Spreading npm Supply-Chain Attack Steals Developer Credentials

· Original article ↗

Summary

Researchers reported compromised Namastex Labs packages whose malware steals developer secrets and attempts to spread through npm and PyPI. Similarities to TeamPCP’s CanisterWorm were noted, but attribution remains unconfirmed.

Key points

  • Researchers from Socket and StepSecurity identified compromised Namastex Labs npm packages, including pgserve.
  • Injected code collects tokens, API keys, SSH keys, cloud and CI/CD credentials, and other sensitive data.
  • The malware can use npm publish tokens to inject itself into packages those tokens can publish, then republish them at higher versions.
  • Researchers said the attack can also target Python packages through PyPI when credentials are available.
  • The techniques resemble TeamPCP’s CanisterWorm, but researchers could not confidently attribute the attack to that group.
  • Recommended actions include removing affected package versions, rotating potentially exposed secrets, and auditing internal mirrors, artifacts, and caches.

Article Details

Event Type
Self-propagating npm supply-chain attack involving compromised Namastex Labs packages.
Impact
Researchers from Socket and StepSecurity report that malicious package versions steal developer credentials and secrets, including tokens, API keys, SSH keys, cloud and CI/CD credentials, and data from browsers and cryptocurrency wallets. The code can republish itself to packages accessible with stolen npm publish tokens and may spread to Python packages when PyPI credentials are found. Researchers noted similarities to TeamPCP’s CanisterWorm attacks but said they could not confidently attribute this attack to TeamPCP.

MITRE ATT&CK

Threat Actors

Malware

Products

Related Articles