{"id":7821,"date":"2026-09-21T22:59:24","date_gmt":"2026-09-21T22:59:24","guid":{"rendered":"https:\/\/lockitsoft.com\/?p=7821"},"modified":"2026-09-21T22:59:24","modified_gmt":"2026-09-21T22:59:24","slug":"new-npm-malware-finds-a-way-around-install-script-defenses","status":"publish","type":"post","link":"https:\/\/lockitsoft.com\/?p=7821","title":{"rendered":"New npm malware finds a way around install script defenses"},"content":{"rendered":"<p>The discovery, detailed by researchers at Checkmarx, highlights a shift toward &quot;stealth-first&quot; delivery methods. This incident follows a broader industry trend where platforms like npm have moved to restrict the execution of lifecycle scripts. In June, GitHub, which owns npm, implemented tighter controls to prevent automatic install script execution, forcing attackers to innovate to maintain their access to target environments.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/lockitsoft.com\/?p=7821\/#The_Anatomy_of_the_Attack_From_Runtime_to_Blockchain\" >The Anatomy of the Attack: From Runtime to Blockchain<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/lockitsoft.com\/?p=7821\/#Chronology_and_Expansion_of_the_Campaign\" >Chronology and Expansion of the Campaign<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/lockitsoft.com\/?p=7821\/#Security_Implications_and_Industry_Response\" >Security Implications and Industry Response<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/lockitsoft.com\/?p=7821\/#Broader_Impact_on_the_Developer_Ecosystem\" >Broader Impact on the Developer Ecosystem<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"The_Anatomy_of_the_Attack_From_Runtime_to_Blockchain\"><\/span>The Anatomy of the Attack: From Runtime to Blockchain<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The core of the malicious operation resided in the routine JavaScript function BTree.prototype.set. Unlike traditional malware that triggers upon installation, this code remained dormant until the application performed a specific operation. When the method received a particular key value, it acted as a trigger, launching an obfuscated first-stage loader as a detached Node.js process. This design is particularly dangerous because it blends seamlessly into the standard execution flow of an application, making it invisible to static analysis tools that primarily scan for suspicious &quot;preinstall&quot; or &quot;postinstall&quot; configurations in the package.json file.<\/p>\n<p>Once the payload was active, the loader engaged in host fingerprinting. It systematically gathered telemetry data, including OS architecture, CPU information, available memory, and system uptime. This data serves as a precursor to more targeted exploitation, allowing the attackers to tailor subsequent payloads based on the perceived value of the compromised environment. The stolen information was then exfiltrated to hardcoded Slack and Telegram channels, providing the attackers with real-time access to the victim&#8217;s infrastructure details.<\/p>\n<p>Perhaps the most innovative aspect of this campaign is its use of the Sepolia Ethereum testnet as a decentralized command-and-control (C2) infrastructure. Rather than hardcoding a domain or IP address\u2014which could be easily flagged, blocked, or seized by authorities\u2014the attackers utilized a smart contract. By using getter and setter functions within the contract, the malware could poll for instructions. If a domain or server was taken down, the attackers could simply update the smart contract with a new address. This decentralized &quot;pointer&quot; system offers a level of resilience that traditional C2 architectures cannot match, significantly complicating incident response and remediation efforts.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Chronology_and_Expansion_of_the_Campaign\"><\/span>Chronology and Expansion of the Campaign<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The campaign was not an isolated event but a coordinated effort involving at least ten distinct npm packages. The primary malicious entity was supported by a cluster of secondary libraries, including ordered-kv-index, btree-leaderboard, priority-slot-queue, btree-range-store, btree-core, btree-time-index, btree-lru-cache, neighbor-key-map, and sliding-score-window.<\/p>\n<p>The sheer scale of the distribution is evidenced by the download metrics: btree-core alone accounted for over 1.9 million downloads, while several others saw hundreds of thousands of installations. These packages were designed to look like legitimate utility libraries, likely targeting developers searching for efficient B-tree data structures for high-performance applications.<\/p>\n<p>To bolster their credibility, the attackers maintained a polished GitHub repository. Every aspect of the project, from the commit history to the developer profile, was crafted to appear authentic. Notably, the repository contained legitimate-looking documentation and code, but the malicious components were carefully excluded from the public repository, a technique known as &quot;clean-room&quot; hosting. The account associated with the project even utilized an AI-generated profile image, a common tactic used to bypass basic identity verification and foster a sense of trust among potential users.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Security_Implications_and_Industry_Response\"><\/span>Security Implications and Industry Response<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The fallout from this campaign underscores the fragility of the open-source supply chain. The npm registry, which hosts millions of packages, relies heavily on community vigilance. When developers include third-party code, they are inherently trusting that the code will perform its intended function without hidden side effects.<\/p>\n<p>Security analysts at Checkmarx have emphasized that this incident serves as a wake-up call for organizations relying on automated dependency management. The ability of attackers to hide malicious code within legitimate prototype functions means that traditional security auditing\u2014which often focuses on the installation phase\u2014is no longer sufficient. Security teams must now implement runtime behavior monitoring and behavioral analysis to detect when a standard library function begins to deviate from its intended behavior, such as opening unexpected network connections or spawning detached processes.<\/p>\n<p>Furthermore, the cleanup functionality built into the malware\u2014which actively removed the trigger code and deleted files after execution\u2014demonstrates an intent to minimize the footprint of the attack. By &quot;self-destructing&quot; after the initial data exfiltration or secondary payload deployment, the malware effectively hides the evidence of its presence, making forensic analysis significantly more difficult.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Broader_Impact_on_the_Developer_Ecosystem\"><\/span>Broader Impact on the Developer Ecosystem<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>This incident has prompted calls for a more robust verification process within the Node.js ecosystem. While npm has taken steps to limit lifecycle scripts, the threat landscape is rapidly shifting toward more sophisticated obfuscation. The use of blockchain technology for C2 represents a dangerous &quot;high-tech&quot; upgrade for common malware, one that security vendors are only just beginning to track effectively.<\/p>\n<p>For organizations, the primary takeaway is the necessity of a &quot;Zero Trust&quot; approach to dependencies. This includes:<\/p>\n<ol>\n<li><strong>Dependency Pinning:<\/strong> Using hash-verified versions of libraries to prevent silent updates from injecting malicious code.<\/li>\n<li><strong>Runtime Sandboxing:<\/strong> Implementing tools that limit the capabilities of Node.js processes, such as restricting access to sensitive system files or outbound network requests.<\/li>\n<li><strong>Vulnerability Scanning:<\/strong> Moving beyond simple CVE matching to include behavioral analysis tools that can flag suspicious library activity.<\/li>\n<li><strong>Network Monitoring:<\/strong> Monitoring for connections to non-standard domains or unexpected blockchain-based communications.<\/li>\n<\/ol>\n<p>The campaign remains under active investigation. Checkmarx has provided a comprehensive list of Indicators of Compromise (IOCs) to help security teams identify if these packages were ever present in their environments. As the investigation progresses, it is expected that more details regarding the second-stage payload\u2014and the full extent of the data theft\u2014will emerge.<\/p>\n<p>Ultimately, the event illustrates the &quot;cat-and-mouse&quot; nature of supply chain security. As platforms like GitHub and npm close off &quot;low-hanging fruit&quot; vulnerabilities like malicious install scripts, attackers are digging deeper into the application logic itself. The shift from targeting the installation process to targeting the runtime environment requires a fundamental shift in how developers and security professionals approach dependency management. It is no longer enough to trust a package based on its download count or its professional appearance; every library, regardless of its reputation or utility, must be treated as a potential vector for compromise.<\/p>\n<p>In the wake of this revelation, the open-source community is once again forced to reckon with the trade-offs between speed, convenience, and security. The ease with which these packages were adopted by millions of users highlights the immense pressure on developers to move quickly, often at the expense of rigorous security audits. Moving forward, the focus must shift toward more resilient infrastructure, decentralized threat intelligence, and a greater emphasis on the integrity of the entire software development lifecycle, from the initial commit to the final deployment.<\/p>\n<!-- RatingBintangAjaib -->","protected":false},"excerpt":{"rendered":"<p>The discovery, detailed by researchers at Checkmarx, highlights a shift toward &quot;stealth-first&quot; delivery methods. This incident follows a broader industry trend where platforms like npm have moved to restrict the execution of lifecycle scripts. In June, GitHub, which owns npm, implemented tighter controls to prevent automatic install script execution, forcing attackers to innovate to maintain &hellip;<\/p>\n","protected":false},"author":17,"featured_media":7820,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71],"tags":[4440,72,1735,74,2497,73,4441,879,4442],"class_list":["post-7821","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud-computing","tag-around","tag-cloud","tag-defenses","tag-devops","tag-finds","tag-infrastructure","tag-install","tag-malware","tag-script"],"_links":{"self":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts\/7821","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7821"}],"version-history":[{"count":0,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts\/7821\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/media\/7820"}],"wp:attachment":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}