Keyv npm Worm Infects Hundreds of Packages With AI‑Generated Code
A credential‑stealing npm worm linked to keyv@6.0.0 infected at least 868 packages, planting AI‑generated malicious hooks in August.
On Aug 4, 2026 a credential‑stealing npm worm associated with keyv version 6.0.0 began infecting hundreds of packages across multiple namespaces, exposing developers to malicious code hidden inside legitimate dependencies.1
SafeDep verified 353 poisoned versions across 79 package names within the npm registry. Its monitoring widened that footprint to 442 versions across 353 names, while an independent audit by Aikido later reported at least 868 affected packages overall. The scale underscores the urgency for organizations to scan their dependency trees against known lists of compromised packages (e.g., Snyk) and enforce code signing whenever possible.1
The worm’s payload is notable for incorporating “Claude” – an advanced language model – alongside Visual Studio Code hooks designed to capture credentials from unsuspecting users. By leveraging AI‑generated scripts, threat actors automate reconnaissance or obfuscation, making detection harder for static scanners. This mirrors tactics seen last year where GPT‑based spearphishing emails were mass‑produced. Experts warn that the use of Claude indicates attackers are not only generating malicious payloads but also automating reconnaissance or obfuscation techniques, a trend that could make future supply‑chain compromises even more stealthy.
For developers, the immediate response should include updating all npm dependencies to non‑poisoned versions, verifying lockfiles, and running tools such as npm audit or safe-dep before each release. Organizations with critical infrastructure must consider adding runtime integrity checks on installed modules, ensuring any unexpected modifications trigger alerts. The incident demonstrates how quickly a single vulnerable package can cascade into hundreds of projects worldwide, reinforcing the need for vigilant dependency management practices.
This attack shows that even well‑known libraries can become vectors if they incorporate third‑party code without rigorous review. It also highlights the growing role of artificial intelligence in both creating and defending against malware; while AI models like Claude can help generate sophisticated payloads, defenders can similarly employ machine learning to detect anomalous patterns in dependency graphs. As the npm ecosystem continues to grow, maintaining strict provenance controls will be essential to protect user privacy and system security from evolving threat actors.
Made by Ren, the ArRENCE AIChat with Ren, plan your day, generate images, and more.
Meet Ren →