Full Report
A malicious npm package named "indexed-btree" has been observed hiding its malicious behavior within application code rather than using lifecycle scripts, indicating that threat actors are likely shifting tactics in response to recent security controls. "Indexed-btree is a malicious npm package mimicking the legit sorted-btree package, an ordinary B-tree/indexing utility," Checkmarx said. "
Analysis Summary
# Tool/Technique: indexed-btree (Malicious npm Package)
## Overview
**indexed-btree** is a malicious npm package designed to mimic the legitimate "sorted-btree" utility. Its primary purpose is to execute a multi-stage supply chain attack. Notably, it avoids traditional lifecycle scripts (preinstall/postinstall) to bypass new security controls in npm version 12, instead embedding its loader directly within the library's runtime logic.
## Technical Details
- **Type:** Malware / Supply Chain Attack Tool
- **Platform:** Cross-platform (Node.js environments / Web applications)
- **Capabilities:** Host fingerprinting, data exfiltration, blockchain-based payload retrieval (EtherHiding), and self-deletion/cleanup.
- **First Seen:** June 18, 2026
## MITRE ATT&CK Mapping
- **[TA0001 - Initial Access]**
- [T1195.002 - Supply Chain Compromise: Compromise Software Dependencies]
- **[TA0002 - Execution]**
- [T1059.007 - Command and Scripting Interpreter: JavaScript]
- **[TA0005 - Defense Evasion]**
- [T1027 - Obfuscated Files or Information]
- [T1070 - Indicator Removal]
- [T1564 - Hide Artifacts]
- **[TA0007 - Discovery]**
- [T1082 - System Information Discovery]
- **[TA0011 - Command and Control]**
- [T1102.003 - Web Service: One-Way Communication (Telegram/Slack)]
- [T1584.009 - Compromise Infrastructure: Cloud Stealer (Blockchain/Smart Contracts)]
## Functionality
### Core Capabilities
- **Runtime Execution:** Unlike typical npm malware, the code activates only when a specific method (`BTree.prototype.set()`) is called by the victim application, bypassing install-time scanners that look for lifecycle hooks.
- **Host Fingerprinting:** Collects detailed information about the infected machine to identify the target environment.
- **Beaconing:** Sends host details to attackers via hard-coded Slack channels and Telegram bots.
### Advanced Features
- **EtherHiding Technique:** The malware retrieves its encrypted second-stage payload by reading data from a smart contract deployed on the Ethereum Sepolia testnet.
- **Anti-Forensics:** Once the second-stage payload is successfully merged and executed, the malware deletes its local artifacts and reverts the changes in the package code to hide the trigger mechanism.
- **Typosquatting/Masquerading:** Mimics the "sorted-btree" package to trick developers into manual installation or automated dependency inclusion.
## Indicators of Compromise
- **File Names:**
- `sharedLoad.min.js` (JavaScript payload/loader)
- **Network Indicators:**
- `sepolia.etherscan[.]io/address/0xE390863Dac96a7118C71227C2b099B50cF602D31` (Smart Contract Source)
- Hard-coded Telegram API endpoints
- Hard-coded Slack Webhooks
- **Behavioral Indicators:**
- Unexpected network traffic from Node.js processes to Telegram/Slack.
- Unusual activity triggered by B-tree indexing operations.
- Modification of files within the `node_modules` directory after execution.
## Associated Threat Actors
- **Attributed to:** Unknown (npm user: **charlessadler25**)
## Detection Methods
- **Behavioral Detection:** Monitor for Node.js applications initiating outbound connections to blockchain explorers (Etherscan) or messaging platforms (Telegram/Slack) if not explicitly required for business logic.
- **Static Analysis:** Scan for obfuscated JavaScript strings and the presence of `sharedLoad.min.js` within third-party libraries.
- **Integrity Monitoring:** Detect unauthorized modifications to files within `node_modules` at runtime.
## Mitigation Strategies
- **Runtime Analysis:** Implement security tooling that monitors application behavior in production, not just during CI/CD or installation.
- **Dependency Pinning:** Use `package-lock.json` and verify the integrity hashes of all dependencies.
- **Network Egress Filtering:** Restrict server environments from communicating with unauthorized external domains (e.g., social media APIs, blockchain testnets).
- **Vetting:** Manually audit new or low-reputation packages, even if they appear to have high download counts (which can be faked).
## Related Tools/Techniques
- **EtherHiding:** The specific method of using smart contracts to host malicious code.
- **Associated Malicious Packages:**
- `ordered-kv-index`
- `btree-leaderboard`
- `priority-slot-queue`
- `btree-range-store`
- `btree-core`
- `btree-time-index`
- `btree-lru-cache`
- `neighbor-key-map`
- `sliding-score-window`
- `mutex-forge`