Massive npm attack: 67 malicious packages distribute advanced malware

  • 67 malicious packages were detected on npm, linked to North Korean actors.
  • The goal was to distribute sophisticated malware, such as XORIndex Loader, BeaverTail, and InvisibleFerret.
  • The campaigns employ advanced techniques to evade and impersonate legitimate projects.
  • Developers are advised to strengthen their supply chain security and thoroughly analyze packages before use.

generic npm logo

In recent months, there has been a significant escalation in malware distribution through the npm repository , the most widely used package manager in the Node.js ecosystem. Various cybersecurity teams have detected that actors linked to North Korea are behind a wave of 67 malicious packages , downloaded more than 17.000 times before being identified and removed, as part of the campaign known as "Contagious Interview."

The attackers' strategy involves infiltrating open development environments by leveraging the popularity of npm , impersonating legitimate projects, and applying subtle changes to avoid detection. As a result, developers and organizations that rely on these packages to automate and accelerate their workflows can be compromised without realizing it.

"Contagious Interview" Campaign: The Persistent Threat on npm

This operation, dubbed "Contagious Interview," is not an isolated incident , but rather a long-standing scheme employed by North Korean state groups. One of the tactics detected involves fake job offers primarily targeting software development professionals. The "selection" process includes purported technical tests for candidates, which actually consist of installing one of the infected npm packages, thus allowing the malware to run on their devices.

The ultimate goal of these attacks is to steal sensitive data , such as credentials, cryptocurrency files, or information about business systems, and to maintain persistent access to the compromised computers.

Compromised packages and deception techniques

Among the 67 identified packages are names that mimic well-known tools and libraries in the JavaScript ecosystem, such as "vite-meta-plugin," "vite-postcss-tools," and "js-prettier." Often, the difference lies in a slight variation or typo compared to the real name, making it difficult for users to detect the deception. These types of techniques have also been used in other malware campaigns on the AUR.

Installing one of these packages triggers a post-installation script that launches the "XORIndex Loader," a malicious component specifically designed to evade traditional detection systems. This loader gathers device information, sends it to servers controlled by the attackers (using legitimate infrastructure like Vercel), and receives instructions to download and execute additional malicious modules, such as "BeaverTail" and "InvisibleFerret."

This modular update capability allows malware to evolve and adapt to cleanup attempts, creating a "whack-a-mole" dynamic where attackers upload updated variants as researchers detect and remove previous ones.

Technical operation: obfuscation and persistence

The "XORIndex Loader" is notable for its use of advanced obfuscation techniques , such as XOR encoding of text strings and rotation of multiple command and control endpoints. After collecting diverse data such as username, hostname, operating system type, IP address, and device geolocation, the loader executes JavaScript scripts received from the attackers' servers using "eval()" functions, allowing it to download and activate additional payloads without user interaction. Malware detection in official repositories has also increased in recent months.

The second scenario involves "BeaverTail," a specialist in extracting sensitive information from cryptocurrency wallets and directories of widely used browser extensions. The stolen files are compressed and sent to IP addresses controlled by the criminals. Subsequently, the "InvisibleFerret" backdoor is activated to maintain long-term control over the system.

Experts have found that these mechanisms affect Windows, macOS, and Linux users equally , which expands the potential reach of the attack.

They detect phishing in open repositories
Related article:
Multiple malware detected in open repositories

Recommendations and defense measures

Companies that rely on the npm ecosystem and independent developers should exercise extreme caution, especially when receiving unexpected job offers or unfamiliar packages. Researchers advise:

  • Verify the authorship and reputation of packages before installing them.
  • Analyze source code for obfuscation techniques or suspicious scripts.
  • use tools real time analysis, such as browser extensions or integrations into version control platforms like GitHub, that alert you to potential dependency risks.
  • Prioritize the use of projects maintained by active communities and with a transparent track record.
  • Run new libraries in sandboxes before moving to production.

The "Contagious Interview" campaign and the emergence of loaders like XORIndex highlight the importance of strengthening security controls in the software supply chain and the need to be vigilant for any signs of suspicious activity in npm repositories. Collaboration between developers, platforms, and cybersecurity experts will be essential to prevent these threats, which, due to their scope and sophistication, pose a challenge to thousands of professionals and companies worldwide.

ESET Linux
Related article:
ESET identified 21 malicious packages that replace OpenSSH

Add as preferred source in Google