Supply Chain Crisis: Keyv & Flat-Cache npm Packages Poisoned with Credential-Stealing Worm
Executive Summary
In one of the largest open-source software supply chain compromises of 2026, security researchers at Aikido Security disclosed on August 4, 2026, that the popular keyv, flat-cache, file-entry-cache, and cacheable npm packages were hijacked by malicious actors. With a combined download volume exceeding 1.2 billion monthly installations, these JavaScript caching libraries are embedded across millions of web applications and enterprise CI/CD pipelines. Attackers compromised the primary maintainer's GitHub credentials and pushed a credential-harvesting worm directly to repository main branches, publishing infected package versions signed with valid npm provenance via automated GitHub Actions workflows.
Technical Deep-Dive into the npm Supply Chain Worm
The attack represents a highly sophisticated, self-propagating CI/CD supply chain infection:
1. Repository Hijacking & Cryptographic Provenance Abuse
Threat actors bypassed standard review controls by compromising maintainer account access:
* Direct Commit Execution: Attackers pushed obfuscated malicious files (dist/cache-helper.js) directly to GitHub main branches, bypassing pull request approvals.
* Provenance Verification Abuse: Because the malicious releases (keyv@5.2.0, flat-cache@6.1.1, file-entry-cache@9.1.1) were built and published through official GitHub Actions CI/CD workflows, the infected packages received valid Sigstore / OIDC cryptographic provenance signatures, tricking automated security scanners into trusting the corrupted dependencies.
2. CI/CD Environment Variable Exfiltration Mechanics
Once installed during npm install or application startup, the injected payload executes silently:
* Credential Harvesting: The script inspects the running process.env object, extracting sensitive environment tokens including AWS_SECRET_ACCESS_KEY, NPM_TOKEN, GITHUB_TOKEN, SLACK_WEBHOOK_URL, and database connection strings.
* Exfiltration Channel: Harvested credentials are base64-encoded and transmitted via HTTPS POST requests to attacker-controlled server endpoints (api.cache-analytics[.]org).
Impact Summary
Category
Details
Target Ecosystem
Node.js / npm Open-Source Ecosystem
Impacted Packages
keyv, flat-cache, file-entry-cache, cacheable
Infected Versions
keyv@5.2.0, flat-cache@6.1.1, file-entry-cache@9.1.1
Download Impact
~1.2 Billion Monthly Downloads
Primary Threat
Secret Key Exfiltration, CI/CD Pipeline Hijacking
Software Supply Chain Risks in Modern Web Development
The keyv ecosystem breach highlights the critical fragility of transitive dependencies in modern web application development. Because deep-tier caching utilities are automatically pulled into thousands of top-level projects, a single compromised maintainer account can compromise downstream cloud infrastructure across Fortune 500 enterprises within minutes.
Cryptographic provenance alone is insufficient if maintainer accounts lack hardware-based multi-factor authentication (MFA) and commit-signing requirements.
Recommendations and Mitigations
All software development teams and DevOps leads using Node.js/npm dependencies must take immediate remediation action:
1. Pin Dependencies & Lock Infected Package Versions: Inspect package-lock.json and yarn.lock files, removing infected releases (keyv@5.2.0, flat-cache@6.1.1, file-entry-cache@9.1.1) and pinning to known-clean builds (keyv@5.2.1+).
2. Rotate All Exposed CI/CD Secrets & API Tokens: Immediately rotate AWS access keys, GitHub personal access tokens, npm publishing tokens, and database credentials used across CI/CD runners that ingested infected builds between August 4 and August 5, 2026.
3. Enforce Lockfile Strictness & Subresource Integrity: Enable strict lockfile checks in automated build pipelines to block unverified, on-the-fly dependency upgrades.
4. Implement Environment Variable Secret Masking: Restrict build scripts from accessing root environment variables during dependency installation routines (npm install --ignore-scripts).
________________
Reviewer Acknowledgment:
Person
Date