Malicious npm packages evade install-script defenses at runtime
A fake npm package evades security checks by hiding malicious code in normal runtime behavior, generating profits for attackers.
Overview
Threat actorsA person or group that carries out cyberattacks, whether for money, spying, or disruption are using a malicious npm package called indexed-btree to bypass new security measures that block installation scriptsA short program written in an interpreted language to automate tasks in a browser, shell, or application. The package impersonates the legitimate sorted-btree library and has accumulated 2 million weekly downloads. Instead of running code during installation, the malware hides inside the BTree.prototype.set method, which executes when an application uses the package at runtimeThe environment in which a program executes, or the period of time while the program is actively running. This approach allows the malware to evade static scannersUsing automated tools to probe computers, networks, or code for known security flaws and missing patches and taint-analysis tools that check for malicious codeSoftware built to steal data, spy on users, lock files, or take control of a computer during the setup phase. Once active, the malware collects system details like architecture and hostnameThe human-readable label assigned to a computer or server on a local network or the internet, then sends this data to hardcodedPasswords or secret keys written directly into source code instead of stored in a separate vault Slack and Telegram channels. It also communicates with an Ethereum smart contractA self-executing program stored on a blockchain that automatically moves digital assets when set conditions are met on the Sepolia test network to receive commands and decryptTurn ciphertext back into plaintext with the key a second-stage payloadThe part of an attack or malware file that carries out the harmful action on the target.
Terms in this story
- threat actors
- A person or group that carries out cyberattacks, whether for money, spying, or disruption. Security researchers use the term threat actor to refer to a criminal gang, state spy unit, or solo hacker behind a series of intrusions. Security+ objective 2.1 lists the term
- script
- A short program written in an interpreted language to automate tasks in a browser, shell, or application. System administrators write scripts to automate daily maintenance, while attackers often use a script to download malware and disable security settings without dropping a compiled file.
- runtime
- The environment in which a program executes, or the period of time while the program is actively running. A flaw in a container or language runtime can let a program escape its isolation, and runtime security tools watch what a program actually does in memory while it runs.
- scanners
- Using automated tools to probe computers, networks, or code for known security flaws and missing patches. Both defenders and attackers run vulnerability scanning across internet-facing servers to find out which machines are still running outdated software versions. Security+ objective 4.3 lists the term
- malicious code
- Software built to steal data, spy on users, lock files, or take control of a computer. News reports use malware as the umbrella term for viruses, ransomware, spyware, and trojans that criminals install on phones, laptops, or servers without permission. Security+ objective 2.4 lists the term
- hostname
- The human-readable label assigned to a computer or server on a local network or the internet. During an intrusion investigation, logs often identify which employee laptop or internal server was accessed by its hostname alongside its IP address.
- hardcoded
- Passwords or secret keys written directly into source code instead of stored in a separate vault. When a vendor ships a router or server appliance with hardcoded credentials inside its firmware, every customer device shares the exact same secret backdoor password.
- smart contract
- A self-executing program stored on a blockchain that automatically moves digital assets when set conditions are met. Because smart contract code is public and cannot easily be reversed once deployed, a single logic bug in a smart contract can let an attacker drain millions in cryptocurrency.
- decrypt
- Turn ciphertext back into plaintext with the key. Authorized users decrypt protected messages or drives with their secret key, while ransomware victims must either restore from backups or obtain the attacker's key to decrypt their files. From the CYBR 101 room CYBR 101: Ciphers and encryption (part 2)
- payload
- The part of an attack or malware file that carries out the harmful action on the target. A phishing email and an exploit are only the delivery steps, while the payload is the ransomware or spyware that actually runs once the computer is compromised.
- npm packages
- A reusable web code library published to the public npm registry for developers to install. Web developers pull in dozens of npm packages when building a site, and attackers frequently publish malicious packages with lookalike names to steal developer credentials during installation. Security+ objective 2.2 lists the term
- wallet
- A software app or hardware device that stores the private keys needed to spend cryptocurrency. If an infostealer copies the secret seed phrase or key file from a victim's cryptocurrency wallet, the attacker can drain the funds irreversibly in seconds.
This page is a short description made for this site. The article itself, with its author's name and its own link, is on the BleepingComputer website. Cite the article, not this page.
Read the full article on BleepingComputer (opens in a new tab)
Course connections
Each line below connects this story to a Security+ objective (a skill on CompTIA's Security+ exam, a common first cybersecurity certification), a CYBR 101 week, or a cybersecurity job, and quotes the words that made the connection.
- Kind of story: Research and reports
"Malicious npm packages evade install-script defenses at runtime..." Found by reading the article; these exact words are in it - Security+ 2.1 Compare and contrast common threat actors and motivations.
"......campaign involving the 'indexed-btree' package shows how threat actors bypass supply chain defenses by hiding malicious..." Found in the opening sentences - Security+ 2.2 Explain common threat vectors and attack surfaces.
"Malicious npm packages evade install-script defenses at runtime..." Found in the headline - Security+ 2.3 Explain various types of vulnerabilities.
"......'indexed-btree' package shows how threat actors bypass supply chain defenses by hiding malicious code in a..." Found in the opening sentences - Security+ 2.4 Given a scenario, analyze indicators of malicious activity.
"An ongoing npm malware campaign involving the 'indexed-btree' package shows how..." Found in the opening sentences - Security+ 5.3 Explain the processes associated with third-party risk assessment and management.
"......'indexed-btree' package shows how threat actors bypass supply chain defenses by hiding malicious code in a..." Found in the opening sentences - CYBR 101 week 2: the CIA triad, threat actors, risk and CVEs
"......campaign involving the 'indexed-btree' package shows how threat actors bypass supply chain defenses by hiding malicious..." Found in the opening sentences - CYBR 101 week 9: malware, indicators and how detection works
"An ongoing npm malware campaign involving the 'indexed-btree' package shows how..." Found in the opening sentences - Job skill (from the U.S. Department of Defense list of cybersecurity jobs): Knowledge of threats to OPSEC when installing, using, modifying, and uninstalling tools.
"...impersonate the legitimate 'sorted-btree' library..." Found by reading the article; these exact words are in it - Job skill (from the U.S. Department of Defense list of cybersecurity jobs): Manage dependencies and risks.
"Malicious npm packages evade install-script defenses at runtime..." Found by reading the article; these exact words are in it
How a story is connected to the course, and every objective, week and job role
Same story at other outlets
- Malicious npm Package indexed-btree Hid Its Loader in Runtime Code Before Removal
- New npm malware finds a way around install script defenses
- Malicious npm package ‘indexed-btree’ evades install-script defenses and detonates at runtime