Skip to content
MediumNews

Keyv-Linked npm Worm Poisons Hundreds of Packages, Plants Claude Code and VS Code Hooks

Published
Record updated
View JSON

Summary

A credential-stealing npm worm that first appeared in keyv@6.0.0 has spread into hundreds of packages across multiple organizations, with SafeDep verifying 353 poisoned versions across 79 package names on August 4, 2026. The malicious release runs a preinstall script that executes a credential-stealing bundle in developer and CI environments, and it can use available npm publishing access to poison more packages. The Keyv repository also retained Claude Code and VS Code hooks that can run the payload once a user trusts the workspace or permits the project configuration.

Mitigation

Socket says any workstation or runner that executed an affected version should be treated as credential-exposed. SafeDep advises responders to remove the malware's credential-revocation watcher before rotating exposed tokens and keys, because revocation triggers the watcher and rotating first can run an attacker-supplied local handler. Exposure checks should use exact package names, resolved versions and lockfiles rather than a cached list of current tags. npm 12 blocks unapproved dependency lifecycle scripts by default, but earlier npm clients and other install paths that permit lifecycle scripts remain exposed.