<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/new-npm-malware-finds-a-way-around-install-script-defenses-efa6kpuxm" -->

---
title: New npm malware finds a way around install script defenses
description: A malicious npm package called indexed-btree impersonated the legitimate sorted-btree library and was downloaded nearly 2 million times per week before...
canonical: https://daily.dev/posts/new-npm-malware-finds-a-way-around-install-script-defenses-efa6kpuxm
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: New npm malware finds a way around install script defenses | daily.dev
og:description: A malicious npm package called indexed-btree impersonated the legitimate sorted-btree library and was downloaded nearly 2 million times per week before...
og:url: https://daily.dev/posts/new-npm-malware-finds-a-way-around-install-script-defenses-efa6kpuxm
og:image: https://api.daily.dev/og/posts/eFA6KpuXM.png
og:image:alt: New npm malware finds a way around install script defenses
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# New npm malware finds a way around install script defenses

**[InfoWorld](https://daily.dev/sources/infoworld)** · 3 min read · 0 upvotes · 0 comments

## Summary

A malicious npm package called indexed-btree impersonated the legitimate sorted-btree library and was downloaded nearly 2 million times per week before Checkmarx flagged and npm removed it on September 3, 2026, roughly 11 weeks after the first malicious version was published. Rather than using preinstall or postinstall lifecycle scripts, the attackers hid their payload inside a normal runtime function, BTree.prototype.set, bypassing the tighter lifecycle-script controls npm introduced in June. When triggered by a specific key value, the code launches an obfuscated loader that fingerprints the host and exfiltrates data via Slack and Telegram. Command-and-control addresses are hidden in a smart contract on the Sepolia Ethereum testnet, making takedown harder, and a second-stage payload is unlocked via shared-secret cryptography. Checkmarx identified nine related packages, some with hundreds of thousands to over 1.9 million downloads, and noted the operators maintained a fake-looking GitHub repo with an AI-generated profile image to appear legitimate. The campaign is reported as ongoing.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.infoworld.com/article/4224395/new-npm-malware-finds-a-way-around-install-script-defenses.html>

## Questions this post answers

### How did the indexed-btree npm malware avoid detection from install script monitoring?

It embedded its malicious code directly inside a runtime function, BTree.prototype.set, instead of using a preinstall or postinstall lifecycle script. When the function receives a specific key value, it launches an obfuscated first-stage loader as a detached Node.js process, bypassing defenses that only monitor install-time scripts and evading the tighter lifecycle-script controls npm introduced in June 2026.

_Teams hardening dependency review workflows can follow emerging npm supply-chain threats on daily.dev._

### How does the indexed-btree npm malware hide its command-and-control server?

It stores the C2 address inside a smart contract deployed on the Sepolia Ethereum testnet rather than using a plain domain or IP. The contract exposes getter and setter functions the malware polls, letting attackers point to a new address whenever the old one is taken down, making it more resilient than traditional domain-based C2 infrastructure.

_Security teams tracking novel C2 techniques can keep up with attacks like this on daily.dev._

### How many downloads did the malicious indexed-btree npm package get before it was removed?

It reached nearly 2 million weekly downloads before Checkmarx flagged it and npm removed it on September 3, 2026, about 11 weeks after the first malicious version was published. A related package, btree-core, had over 1.9 million downloads, and nine other linked packages were also pulled from the registry.

_Developers auditing dependency trees for lookalike packages can follow supply-chain incidents on daily.dev._

## Similar posts on daily.dev

- [Your npm install was safe. What happens when the package runs?](https://daily.dev/posts/your-npm-install-was-safe-what-happens-when-the-package-runs--nkcyzx4rn) · InfoWorld · 2 upvotes · 0 comments
- [Massive ChainDrop npm supply-chain attack infects hundreds of packages](https://daily.dev/posts/massive-chaindrop-npm-supply-chain-attack-infects-hundreds-of-packages-uhzbslfdu) · BleepingComputer · 3 upvotes · 1 comments

---

Tags: [#cyber](https://daily.dev/tags/cyber), [#javascript](https://daily.dev/tags/javascript), [#nodejs](https://daily.dev/tags/nodejs), [#malware](https://daily.dev/tags/malware), [#npm](https://daily.dev/tags/npm)

[View this post on daily.dev](https://daily.dev/posts/new-npm-malware-finds-a-way-around-install-script-defenses-efa6kpuxm)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"New npm malware finds a way around install script defenses","url":"https://daily.dev/posts/new-npm-malware-finds-a-way-around-install-script-defenses-efa6kpuxm","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/new-npm-malware-finds-a-way-around-install-script-defenses-efa6kpuxm"},"datePublished":"2026-09-21T14:26:35.428Z","dateModified":"2026-09-24T11:13:05.207Z","description":"A malicious npm package called indexed-btree impersonated the legitimate sorted-btree library and was downloaded nearly 2 million times per week before...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/54fa6ba3c75e6a78327009ab140b3cee?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/54fa6ba3c75e6a78327009ab140b3cee?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"InfoWorld","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"InfoWorld","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/bf6d68a999064029b0bb09aa6268f1f3","url":"https://daily.dev/sources/infoworld"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/new-npm-malware-finds-a-way-around-install-script-defenses-efa6kpuxm","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"cyber,javascript,nodejs,malware,npm","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"InfoWorld","item":"https://daily.dev/sources/infoworld"},{"@type":"ListItem","position":3,"name":"New npm malware finds a way around install script defenses"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/new-npm-malware-finds-a-way-around-install-script-defenses-efa6kpuxm#faq","mainEntity":[{"@type":"Question","name":"How did the indexed-btree npm malware avoid detection from install script monitoring?","acceptedAnswer":{"@type":"Answer","text":"It embedded its malicious code directly inside a runtime function, BTree.prototype.set, instead of using a preinstall or postinstall lifecycle script. When the function receives a specific key value, it launches an obfuscated first-stage loader as a detached Node.js process, bypassing defenses that only monitor install-time scripts and evading the tighter lifecycle-script controls npm introduced in June 2026. Teams hardening dependency review workflows can follow emerging npm supply-chain threats on daily.dev."}},{"@type":"Question","name":"How does the indexed-btree npm malware hide its command-and-control server?","acceptedAnswer":{"@type":"Answer","text":"It stores the C2 address inside a smart contract deployed on the Sepolia Ethereum testnet rather than using a plain domain or IP. The contract exposes getter and setter functions the malware polls, letting attackers point to a new address whenever the old one is taken down, making it more resilient than traditional domain-based C2 infrastructure. Security teams tracking novel C2 techniques can keep up with attacks like this on daily.dev."}},{"@type":"Question","name":"How many downloads did the malicious indexed-btree npm package get before it was removed?","acceptedAnswer":{"@type":"Answer","text":"It reached nearly 2 million weekly downloads before Checkmarx flagged it and npm removed it on September 3, 2026, about 11 weeks after the first malicious version was published. A related package, btree-core, had over 1.9 million downloads, and nine other linked packages were also pulled from the registry. Developers auditing dependency trees for lookalike packages can follow supply-chain incidents on daily.dev."}}]}
```

