Description

Koi Security uncovered a widespread npm supply-chain campaign named PhantomRaven: 126 malicious packages (active since August 2025) that together exceeded ~86,000 downloads and are designed to harvest developer identities, npm tokens, CI/CD secrets and GitHub credentials. The campaign hides its true payloads by using HTTP-based Remote Dynamic Dependencies (RDD) and malicious lifecycle scripts so the packages appear harmless to automated scanners. PhantomRaven leverages two core tricks to evade detection and execute on developer machines. First, authors publish superficially clean packages that declare dependencies pointing to HTTP URLs (RDD), so most static dependency scanners and the registry appear to show “0 dependencies.” At install time npm follows the URL, fetching a remote package hosted on attacker infrastructure and executing its preinstall/preinstall-style lifecycle scripts (for example, "scripts": { "preinstall": "node index.js" }), which run automatically during npm install. The executed payload performs identity harvesting (scanning .gitconfig, .npmrc, environment variables and package.json), system fingerprinting (IP, OS, host, Node version) and targeted credential theft — extracting npm auth tokens, GitHub Actions tokens, GitLab/Jenkins/CircleCI credentials and other CI secrets. Exfiltration uses redundant channels (HTTP GET/POST and WebSocket fallbacks) and the campaign includes operational failures (reused sequential emails) that aided attribution. The attackers also exploited “slopsquatting” — AI-hallucinated package names that look plausible to devs using code assistants — to increase accidental installs.