An ongoing threat involving malicious npm packages has emerged, aiming to compromise developers and pilfer valuable source code and configuration files from their machines. This development underscores the ever-present danger that looms in open-source repositories.
Checkmarx, a software supply chain security firm, has revealed that the orchestrator of this campaign has been linked to malicious activity dating back to 2021. The campaign involves the continuous distribution of these harmful packages, with the most recent report providing a continuation of the threat.
These npm packages are meticulously engineered to activate immediately after installation, leveraging a postinstall hook within the package.json file. This process triggers the execution of preinstall.js, which then spawns index.js to extract system metadata and collect source code and confidential information from specific directories. The culmination of the attack involves compressing the pilfered data into a ZIP archive, which is subsequently sent to a predetermined FTP server. A consistent pattern observed across these malicious packages is the use of “lexi2” as the author within the package.json file, enabling Checkmarx to trace the origins of this activity back to as early as 2021.
While the exact motives behind this campaign remain uncertain, the choice of package names like binarium-client, binarium-crm, and rocketrefer indicates a potential focus on the cryptocurrency sector.
This sector, known for its high-profile targets, continues to be at risk from not only malicious packages but also from persistent adversaries with long-standing and calculated attack strategies. Security researcher Yehuda Gelb stresses the importance of recognizing that the threats faced are not solely related to malicious packages but also encompass meticulously planned attacks that span months or even years.