Last updated: November 2, 2026 at 1:20 PM UTC
All 957 Vulnerability 399 Breach 144 Threat 407 Defense 7
Tag: npm (49 articles)Clear

Planted instructions file tries to trick AI coding agents into installing malicious npm package

Forever Security caught an attempt on a customer's machine to subvert an AI coding agent through a planted instructions file. Coding agents read AGENTS.md or CLAUDE.md files in a folder and follow them, and a web page can drop such a file into Downloads without a click. The disguised file told OpenAI Codex to register a server in its global config and install the npm package function-color, part of the MALFEX campaign, which pulls a Windows payload. Against Claude Code, a CLAUDE.md tried to set ANTHROPIC_BASE_URL to an attacker server to leak the login token. Researchers say there is nothing for vendors to patch.

Check
Do not run coding agents in the Downloads folder, and read any AGENTS.md or CLAUDE.md you did not write before letting an agent act on it.
Affected
Developers whose coding agent reads an attacker-planted instructions file can have it install malicious npm packages or redirect its base URL to leak login tokens.
Fix
Keep agent approval prompts and sandboxes on, inspect config files like the Codex config and project settings for unexpected changes, and rotate tokens if a planted file is found.

npm Trusted Publishing slug-reuse flaw exposed over 1,500 packages to unauthorized takeover

Bloom Security disclosed a flaw in npm's Trusted Publishing, which binds a package to a GitHub repository and workflow. npm recorded the binding by repository slug rather than GitHub's permanent numeric IDs, so once a bound repository or owner was renamed, transferred, or deleted, an attacker could claim the freed slug, add a matching workflow, and receive a publish credential, even forging a valid provenance attestation. Bloom counted more than 1,500 exposed packages with over 10 million total downloads. GitHub, notified in June through HackerOne, shipped a fix in October so unvalidated configurations expire after 48 hours. It is unknown whether anyone exploited the weakness in the wild.

Check
Run npm trust list to confirm each bound repository still belongs to you, rebind any pointing to renamed or transferred repositories, and remove bindings before deleting a repository.
Affected
npm packages bound through Trusted Publishing to a repository or owner that was later renamed, transferred, or deleted could be hijacked by an attacker claiming the freed slug.
Fix
Verify and rebind Trusted Publishing configurations, check that package provenance attestations name the expected repository, and apply the same review to GitLab-based Trusted Publishing.

Compromised Tensorlake npm package spreads Shai-Hulud worm that steals developer credentials and republishes itself

Socket and StepSecurity reported that version 0.5.144 of the tensorlake npm package, a TypeScript SDK, was published with obfuscated malware tied to the Shai-Hulud supply chain attack. A preinstall hook launches a loader that runs a worm under the Bun runtime. It harvests npm, GitHub, AWS, Vault, Kubernetes, and SSH credentials, .env files, cryptocurrency wallets, and configuration for Claude, Cursor, and other tools, then enumerates the victim's other packages and republishes them with forged provenance to spread. A PowerShell monitor watches the stolen GitHub token and runs a destructive handler if the victim revokes it, so remove the package before rotating that token.

Check
Check whether any project installed tensorlake 0.5.144, remove it before revoking tokens to avoid the destructive handler, then rotate all exposed credentials and audit republished packages.
Affected
Developers who installed the compromised tensorlake version had npm, GitHub, cloud, and SSH credentials stolen, and the worm may have republished their own packages with forged provenance.
Fix
Remove the malicious package, rotate npm, GitHub, cloud, and SSH credentials, review published packages and GitHub Actions workflows for tampering, and follow Socket and StepSecurity guidance on token revocation order.

Eight malicious npm packages downloaded over 40,000 times deliver Overlord RAT and credential stealer

CloudSEK and Checkmarx detailed MALFEX, a campaign they attribute to a lone actor who has published eight malicious npm packages downloaded 40,767 times in total, with function-flag alone accounting for 37,419. The Windows-focused packages deliver three payloads: Overlord, an open-source Go remote access trojan that pulls its command-and-control address from Solana transactions; a Node.js stealer that targets Discord, browsers, Telegram, and cryptocurrency wallets; and a downloader. Lifecycle and postinstall hooks fetch and run remote executables, with one package saving a hidden node.exe to the AppData directory. Three packages, function-flag, function-color, and cdn-img-fetch, were still live on npm at publication.

Check
Audit npm dependencies for the named MALFEX packages, remove any that are present, and check Windows hosts for Overlord RAT activity and a hidden node.exe in the AppData directory.
Affected
Windows developers who installed the MALFEX packages, especially function-flag, may be infected with the Overlord remote access trojan or a stealer targeting browsers, Telegram, and wallets.
Fix
Remove the malicious packages, rebuild affected Windows systems, rotate credentials for browsers, Discord, Telegram, and wallets, and block the known payload download domains.

Malicious npm package impersonates Twilio bug bounty probe to exfiltrate developer credentials

ReversingLabs detailed a malicious npm package, tw-pkgprobe-7731, that masquerades as an authorized Twilio bug-bounty research probe while harvesting developer data. Uploaded in mid-August by an account that no longer exists, it shipped eleven versions within about 45 minutes. Comments inside describe it as an authorized HackerOne probe that runs only inside Twilio's serverless sandbox and takes no destructive action. On execution it first checks for a Twilio developer environment and exits otherwise, then collects environment variables plus system details like mounts and temporary folders and exfiltrates them through a webhook. Later versions specifically target developers using Twilio APIs by searching for folders tied to particular Twilio account identifiers, sharpening the credential theft.

Check
Block and audit for tw-pkgprobe-7731 across developer and build environments, then rotate Twilio credentials and API keys exposed on any affected machine.
Affected
Developers integrating Twilio who installed the package inside a matching environment had environment variables and account-linked configuration harvested and sent to an attacker webhook.
Fix
Pin and vet npm dependencies, alert on packages that fingerprint the environment before acting, and restrict outbound webhooks from build and developer hosts.

Malicious npm package hides loader in runtime method to bypass install script controls

Checkmarx found an ongoing npm campaign built around indexed-btree, a package impersonating the popular sorted-btree library that has amassed two million weekly downloads. Instead of using preinstall or postinstall scripts, the malware hides its loader inside the BTree.prototype.set method that applications call constantly, so it executes at runtime rather than install time. This sidesteps the npm approval gates GitHub added in June to block lifecycle scripts, and installation looks clean to static scanners. Once triggered, it fingerprints the host, exfiltrates details over hardcoded Slack and Telegram channels, and polls an Ethereum Sepolia smart contract for encrypted second-stage commands.

Check
Audit dependency trees for indexed-btree and typosquats of sorted-btree, then remove them and rotate any credentials exposed to affected build or runtime hosts.
Affected
Projects that installed indexed-btree run the loader the first time application code calls the tree, giving attackers host fingerprinting and staged command execution.
Fix
Pin dependencies to reviewed versions, scan for runtime-triggered loaders not just install scripts, and block outbound Slack, Telegram, and testnet RPC from build hosts.

Shai-Hulud npm worm now hunts credentials across 469 different locations

Researchers at GitGuardian found that a recent variant of the self-spreading Shai-Hulud npm worm has expanded its credential theft to scan 469 distinct locations on infected developer machines. The targets now span developer environments, continuous integration and deployment tooling, cloud configuration files, and even the configuration of AI tools. That breadth turns a single compromised package into a wide net for secrets, from cloud and registry credentials to keys held by developer and AI tooling. It reflects how supply-chain worms are industrializing secret collection, treating any credential a developer's machine can reach as fair game once malicious code runs during installation or use.

Check
Scan your dependencies and lockfiles for known-compromised packages, rotate any credentials that a developer machine or pipeline can reach, and reduce the number of long-lived secrets stored in reachable configuration files.
Affected
Developers and CI/CD systems that install compromised npm packages; the worm harvests credentials from 469 locations across developer, pipeline, cloud, and AI-tool configurations, then uses them to spread and steal further secrets.
Fix
Pin and vet dependencies, use scoped short-lived tokens instead of long-lived secrets, isolate build environments, monitor for credential access during installs, and keep secrets out of files developer and AI tools read.

Attackers abuse npm and its mirrors to host fake CAPTCHA phishing pages

Researchers at OX Security found a campaign using two dozen npm packages as free phishing infrastructure rather than as malware aimed at developers. Each package is just a single HTML page, harmless to install, but once served through npm content-delivery mirrors like unpkg it becomes a live, fully rendered fake Cloudflare CAPTCHA page hosted on a trusted domain. The page then redirects victims to ClickFix-style phishing infrastructure, and while it currently forwards to a legitimate site, it can be reconfigured to deliver any phishing payload. The trick is not infecting people who install the packages, but abusing the registry and its mirrors as validated, reputable storage for attacker content.

Check
Treat fake CAPTCHA and ClickFix pages as hostile even when served from trusted domains like unpkg, and educate users not to run commands or steps a CAPTCHA prompt tells them to perform.
Affected
Anyone lured to a fake CAPTCHA page hosted on a trusted npm mirror; the pages redirect to ClickFix phishing, exploiting the reputation of legitimate infrastructure to bypass suspicion and some blocking.
Fix
Monitor and filter for HTML content served from package-mirror domains, block known phishing and ClickFix infrastructure, apply reputation-aware web filtering rather than trusting domains outright, and train users on fake CAPTCHA lures.

Fake npm calendar tools drop an AI-assisted Linux backdoor on import

Trend Micro found 14 malicious npm packages that pose as working calendar and streak utilities while secretly installing a Linux backdoor from the commercial RedC2 4.0 toolkit. The packages function as advertised, but on load they locate a bundled binary disguised as a math accelerator, mark it executable, and run it as a detached background process. No install script is needed, so a single import anywhere in the dependency graph, even a transitive one, triggers execution. RedC2 is sold on criminal forums as an evasion-focused command-and-control framework with surveillance, credential theft, tunneling, in-memory payload execution, and AI-assisted command features. It shows how import-time execution keeps making package registries an easy delivery route.

Check
Audit npm dependencies, including transitive ones, for the malicious calendar packages and any bundled binaries, and remove them, since simply importing one runs the backdoor without an install script.
Affected
Developers and systems that installed the trojanized npm calendar packages; importing one anywhere in the dependency tree drops and runs a RedC2 Linux backdoor with surveillance, credential theft, and remote-control capabilities.
Fix
Pin and vet dependencies, watch for packages that bundle binaries or spawn detached processes on import, use lockfiles and isolated builds, and monitor developer and CI hosts for unexpected outbound connections.

Self-spreading npm worm ChainDrop poisons over 1,300 package versions in hours

A self-propagating worm named ChainDrop tore through the npm registry on August 4, poisoning packages that huge parts of the software world depend on. It began by hijacking the GitHub account behind keyv, a caching library pulled in about 150 million times a week, then spread to sibling and downstream packages, reaching over 1,300 poisoned versions with billions of monthly downloads within hours. A preinstall script harvests credentials from developer and continuous integration environments, including AI agent tokens, cloud keys, and self-hosted CI secrets, then uses stolen npm publishing access to poison more packages. A descendant of the earlier Shai-Hulud worm, it even forged valid-looking build provenance.

Check
Compare lockfiles and resolved versions against the published affected-package list, and treat any machine that installed a poisoned version as compromised, but remove the malware's token watcher before rotating anything.
Affected
Developers and CI systems that installed a poisoned version during the attack window; the worm steals repository, registry, cloud, AI agent, and private-key credentials, then self-spreads through npm publishing access.
Fix
Rotate all reachable credentials after removing the token watcher, install with scripts disabled, pin and delay adoption of new versions, and check for injected hooks in developer tooling and continuous integration configuration.