Description

Three popular npm packages—@rspack/core, @rspack/cli, and Vant—were compromised using stolen npm tokens, enabling attackers to publish malicious versions containing cryptomining malware. These versions deployed XMRig to mine Monero cryptocurrency, exploiting the systems of developers who installed the compromised packages. The malware embedded in JavaScript files exploited npm’s postinstall script to execute automatically, gathering victim system data via external APIs and blending into file systems. The attack affected multiple versions of the packages, including widely downloaded tools such as Rspack and Vant, which are crucial in JavaScript bundling and Vue.js UI development. The malicious packages fetched configuration and control instructions from external servers. Specific versions of Rspack (1.1.7) and Vant (2.13.3 through 4.9.14) were found to contain cryptomining scripts. These scripts downloaded mining binaries and executed them covertly, limiting CPU usage to avoid detection. Threat actors used geolocation data to tailor attacks, highlighting the precision of the operation. The compromised Vant package renamed its cryptominer to appear as a helper file, concealing its malicious intent. In response, developers released patched versions—Rspack v1.1.8 and Vant v4.9.15—urging users to upgrade immediately. Both teams apologized for their compromised tokens and implemented additional safeguards to prevent future attacks. This incident underscores the persistent risks in the software supply chain, similar to prior compromises targeting cryptocurrency assets and hardware resources. Developers are advised to audit dependencies and implement strict token security to mitigate these threats.