# Malicious npm package indexed-btree evades install-script restrictions via BTree.prototype.set runtime trigger and Sepolia smart-contract C2

> A supply chain campaign published the malicious npm package indexed-btree, which mimics the legitimate sorted-btree library and hides its loader in BTree.prototype.set instead of install scripts, so it runs when the library is used. It fingerprints hosts, beacons to Slack and Telegram, and retrieves an encrypted second stage from an Ethereum Sepolia smart contract (EtherHiding).

- **Published:** 2026-11-19T01:44:00Z
- **Last reviewed:** 2026-11-19T01:44:00Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-6396
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-6396.png
- **ID:** TL-2026-6396
- **Severity:** HIGH
- **Category:** SUPPLY_CHAIN
- **Status:** ACTIVE
- **Detections:** 9 (1 shown free below) · **IOCs:** 21 (3 shown free below)

## Description

Checkmarx Zero (Bruno Dias) documented a campaign in which the npm package indexed-btree impersonates the legitimate sorted-btree B-tree library. Per Cloud Security Alliance and The Hacker News reporting, the package was first uploaded on 2026-06-18 by the npm account charlessadler25 and was pulled from the registry around 2026-09-03. The attacker also created a GitHub organization/repository (INDEXED-BTREE/indexed-btree) with commit history and a low-activity developer profile with an AI-generated photo. The public repository does not contain the malicious code.

The package.json has no preinstall, install or postinstall script, so it sidesteps npm v12's default disabling of lifecycle scripts and install-time scanners. Instead the loader is injected into BTree.prototype.set(), a method applications call routinely. The loader runs only if extended/sharedLoad.min.js exists and the key passed to set() equals 100 (an execution guardrail). It then spawns a detached node child process (detached: true, stdio: ignore, windowsHide: true, unref()) that runs the heavily obfuscated loader (string-array encoding with self-checksumming array rotation), and swallows all errors.

Stage 1 fingerprints the host (OS architecture, hostname, CPU, memory, uptime) and sends it to a hardcoded Slack channel and Telegram chat. Stage 2 uses a smart contract on the Ethereum Sepolia testnet as the C2 channel rather than a domain or IP: the loader polls the contract's getter/setter functions, which can be repointed to a new address if the old one is taken down. It generates an X25519 keypair, fetches the operator's public key from the contract, derives an ECDH shared secret and an AES key, and decrypts two ciphertext blobs stored in the contract, which are merged into the second-stage payload. Afterwards it deletes its own files and removes the trigger code from BTree.prototype.set, which hinders forensics.

Checkmarx linked nine other packages, all since removed, with a combined 5+ million cumulative downloads (indexed-btree itself reportedly reached nearly 2 million weekly downloads). The same smart contract was previously seen in the mutex-forge package. About 109 ETH (roughly EUR 230,933) was reported as received by the operators. The campaign was described as ongoing, and Checkmarx's Darren Meyer says it is not limited to the btree packages and the C2 infrastructure is still active. No actor attribution is stated in any source. Defenders should treat any environment that ran an affected package as compromised, rotate reachable credentials, and prioritize network/log indicators because the malware deletes its artifacts.

## MITRE ATT&CK

- T1195 Supply Chain Compromise
- T1059.007 JavaScript
- T1036.005 Match Legitimate Resource Name or Location
- T1027 Obfuscated Files or Information
- T1480 Execution Guardrails
- T1140 Deobfuscate/Decode Files or Information
- T1070.004 Indicator Removal: File Deletion
- T1082 System Information Discovery
- T1573.002 Encrypted Channel: Asymmetric Cryptography

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**indexed-btree Runtime Loader — Node Child Executing sharedLoad.min.js (Exploitation)** (`TL-2026-6396-SPL-001`)

Detects a node process whose command line runs extended/sharedLoad.min.js, the obfuscated first-stage loader that indexed-btree and its sibling npm packages spawn as a detached child from BTree.prototype.set() when the key equals 100. The package has no install scripts, so this runtime execution is the earliest reliable host signal. Flags the key-100 execution guardrail argument for higher fidelity.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1195, T1059.007
- **Data sources:** sysmon (EventCode 1), microsoft_defender_for_endpoint (DeviceProcessEvents), windows_process_creation
- **Severity:** high
- **Confidence:** high

### Splunk SPL

````spl
index=sysmon sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1 Image="*\\node.exe" CommandLine="*sharedLoad.min.js*" ```TL-2026-6396 indexed-btree loader: detached node child executing extended/sharedLoad.min.js```
| eval guardrail_key_100=if(match(CommandLine, "sharedLoad\\.min\\.js\\W{1,3}100\\b"), "yes", "no")
| stats count min(_time) as first_seen max(_time) as last_seen values(CommandLine) as command_lines values(ParentImage) as parent_images values(User) as users by host, Image, guardrail_key_100
| convert ctime(first_seen) ctime(last_seen)
| sort - count
````

### Microsoft KQL

```kql
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("node.exe", "node", "nodejs")
| where ProcessCommandLine has "sharedLoad.min.js"
| extend GuardrailKey100 = ProcessCommandLine matches regex @"sharedLoad\.min\.js\W{1,3}100\b"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, GuardrailKey100, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName
```

### Sigma

```yaml
title: Node.js Executing sharedLoad.min.js Loader (indexed-btree Campaign)
id: 6f1b0c52-3a7d-4e8a-9c41-2d5e7a10b601
status: experimental
description: Detects node.exe executing sharedLoad.min.js, the obfuscated loader spawned at runtime by the malicious indexed-btree npm package family (TL-2026-6396).
references:
  - https://checkmarx.com/zero-post/npm-btree-malware-campaign-affects-millions-of-downloads-no-need-for-install-script/
  - https://labs.cloudsecurityalliance.org/research/csa-research-note-npm-runtime-execution-supply-chain-2026092/
  - https://thehackernews.com/2026/09/malicious-npm-package-indexed-btree-hid.html
author: Threadlinqs Team
date: 2026-11-19
tags:
  - attack.initial-access
  - attack.t1195
  - attack.execution
  - attack.t1059.007
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    Image|endswith: '\node.exe'
    CommandLine|contains: 'sharedLoad.min.js'
  condition: selection
falsepositives:
  - Legitimate project that ships its own file named sharedLoad.min.js
level: high

```

**Known false positives:**

- An internal project that legitimately names a bundled script sharedLoad.min.js and runs it with node
- Security researchers detonating the sample in a lab

**Tuning notes:** Windows-focused (Sysmon EventCode 1). On Linux/macOS extend Image to */node and use auditd execve or EDR process telemetry. Any hit with guardrail_key_100=yes should be treated as confirmed execution: isolate the host, rotate reachable credentials and rebuild. Allow-list only after confirming the file hash is not the obfuscated loader.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- Malicious [indicator] Package Family Written to node_modules (Exploitation) (locked: unlock with TL Creds)
- [indicator] Stage-1 Fingerprint Beacon — Node to Telegram/Slack API (Post-Exploitation) (locked: unlock with TL Creds)
- EtherHiding Contract Polling — Repeated Sepolia RPC Connections by Non-Browser Process (C2) (locked: unlock with TL Creds)
- npm/yarn/pnpm Installing [indicator] Family Package (Exploitation) (locked: unlock with TL Creds)
- Detached Node Child Spawned by Node Running a .min.js File (Post-Exploitation) (locked: unlock with TL Creds)
- Non-Browser Web Traffic to Sepolia RPC Endpoints — EtherHiding C2 via Proxy (C2) (locked: unlock with TL Creds)
- [indicator] Anti-Forensics — Node Deleting sharedLoad.min.js After Execution (Post-Exploitation) (locked: unlock with TL Creds)
- EtherHiding C2 — Node Resolving Sepolia RPC Endpoints (C2) (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sample indicators (3 of 21)

Defanged, TLP:CLEAR.

- Domain: `eth-sepolia[.]g[.]alchemy[.]com`
- File hash: `bad013df6eec5d686f4cc8551e0a5c87a0135164bdd1dafb1c75141d1b526702`
- Domain: `sepolia[.]infura[.]io`

Full set of 21 indicators unlocks with TL Creds: https://threadlinqs.com/tl-creds

## Sources

- [Dependency installation security measure already defeated on npm](https://www.reversinglabs.com/blog/npm-dependency-installation-security-measure-defeated)
- [Checkmarx Zero: npm btree malware campaign affects millions of downloads, no need for install script](https://checkmarx.com/zero-post/npm-btree-malware-campaign-affects-millions-of-downloads-no-need-for-install-script/)
- [The Hacker News: Malicious npm package indexed-btree hid malware in runtime code](https://thehackernews.com/2026/09/malicious-npm-package-indexed-btree-hid.html)
- [SecurityWeek: Malicious B-tree npm package accumulates millions of downloads](https://www.securityweek.com/malicious-b-tree-npm-package-accumulates-millions-of-downloads/)
- [CSA Research Note: npm's indexed-btree Campaign Moves Malware to Runtime](https://labs.cloudsecurityalliance.org/research/csa-research-note-npm-runtime-execution-supply-chain-2026092/)
- [Attacker GitHub repository INDEXED-BTREE/indexed-btree (no malicious code in repo)](https://github.com/INDEXED-BTREE/indexed-btree)
- [DevOps.com: New npm threat bypasses install script protections](https://devops.com/new-npm-threat-bypasses-install-script-protections/)
- [BleepingComputer: Malicious npm packages evade install script defenses at runtime](https://www.bleepingcomputer.com/news/security/malicious-npm-packages-evade-install-script-defenses-at-runtime/)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-6396
