This Monday, security researchers discovered the largest supply chain attack in npm history, compromising 18 fundamental JavaScript packages, including chalk, debug, and ansi-styles, which represent over 2.6 billion weekly downloads. Josh Junon (qix), maintainer of these critical JavaScript ecosystem packages, had his npm account compromised through a sophisticated phishing attack.
The attack began when Junon received a fraudulent email threatening to block maintainer accounts on September 10th, requesting 2FA credential updates to induce clicking on the malicious link. Junon himself confirmed falling for the scam in a HackerNews forum post.
The attackers injected highly obfuscated malicious code into the packages, creating a browser-based interceptor designed to steal cryptocurrencies. The malware intercepts digital wallet transactions like MetaMask and Phantom, altering data before user signatures. It modifies functions such as fetch, XMLHttpRequest, and wallet APIs, replacing legitimate addresses with attacker-controlled ones, redirecting funds without user knowledge.
The compromised packages include ansi-styles (371 million weekly downloads), debug (357 million), chalk (300 million), and supports-color (287 million). These components serve as dependencies for thousands of applications, from startups to Fortune 500 companies, potentially exposing users to cryptocurrency theft.
Rapid detection was crucial in limiting damage. The attack was identified within five minutes and disclosed within an hour by Aikido Security. Npm initiated removal of malicious versions, though some packages remained compromised at the time of disclosure. The incident exposes the fragility of the open-source supply chain, where a single compromised account can affect billions of installations globally.
Recommendations:
- Immediately assess the presence of compromised versions of affected packages in your projects, investigating recent installation logs and performing complete environment audits.
- Implement continuous dependency verification with tools like npm audit, Snyk, or Socket.dev for proactive real-time vulnerability detection.
- Establish cooldown policies of at least 48 hours before updating critical dependencies, allowing adequate time for identifying potential compromises.
- Review and strengthen internal approval processes for library updates, treating
package-lock.json
changes with rigor equivalent to application code. - Investigate all credentials, keys, and digital wallet activities for environments using web3 applications, implementing enhanced monitoring of suspicious transactions.
- Strengthen authentication controls and phishing awareness, guiding teams to verify email legitimacy before clicking suspicious links.
- Adopt managed supply chain monitoring services like those offered by SEK, including proactive detection and specialized incident response.
SEK continues monitoring the situation and is available to assist with security control implementation, exposure assessment, and dependency compromise response.