AI-generated editorial illustration; not a documentary photograph.
A malicious npm package called indexed-btree concealed its loader inside ordinary application logic instead of using preinstall or postinstall scripts, according to software supply-chain security company Checkmarx. The package and its associated GitHub repository have since been removed from download, but the incident shows how attackers are adapting to newer installation safeguards.
Runtime execution replaced install hooks
The package reportedly imitated sorted-btree, a legitimate B-tree and indexing utility. Its malicious behavior was placed in the BTree.prototype.set() method, which triggered a file named sharedLoad.min.js containing an obfuscated first-stage payload. That design allows execution during normal library use, rather than requiring code to run automatically when the dependency is installed.
The campaign emerged after npm version 12 introduced a security change intended to prevent automatic execution of lifecycle scripts. Those hooks remain useful for legitimate build and setup tasks, but they have also been a common route for package malware. Blocking them therefore addresses one execution path, not runtime abuse inside a dependency.
A concealed multi-stage payload
Checkmarx said the malware fingerprinted the host and sent collected details to a hard-coded Slack channel and Telegram bot. It then used EtherHiding to retrieve encrypted next-stage data from a smart contract on the Sepolia testnet, assembled a second-stage payload, and removed malicious artifacts and its trigger to obscure the activity.
The package was first uploaded on June 18, 2026, under the npm account charlessadler25 and accumulated millions of downloads in a short period, according to the report. The operation may also have generated about €230,933.57, or 109 ETH, for its operator; that figure is presented as an estimate rather than confirmed revenue.
Related repository compromise
Separately, Socket reported removing malicious code from the dev-main version of the Packagist package visanduma/nova-two-factor, which had more than 700,000 cumulative downloads. Socket linked that activity to the PolinRider campaign and said compromised developer accounts were used to seed repositories with triggers activated by routine actions such as cloning code or opening it in an IDE.
The reported techniques included rewritten Git history, concealed payloads in configuration or font files, malicious VS Code auto-run tasks, and staged delivery through blockchain infrastructure. Socket said the latest variation also inserted obfuscated JavaScript into index.php and invoked it through PHP's shell_exec(), adapting the execution route to the compromised project.
Implications for dependency checks
The incidents indicate that developers cannot treat lifecycle-script restrictions or install-time scanning as complete protection. The security companies recommend adding runtime behavior analysis and controls that inspect dependencies before installation, during execution, and after deployment.
Source: Malicious npm Package indexed-btree Hid Its Loader in Runtime Code Before Removal

Leave a Reply