Skip to main content
444 Packages Infected: The ChainDrop Worm TeardownIncident
4 min readFor Security Engineers

444 Packages Infected: The ChainDrop Worm Teardown

A self-propagating worm infiltrated the npm ecosystem, compromising 444 packages that collectively serve over 2 billion monthly downloads. The attack, dubbed ChainDrop, didn't exploit a zero-day vulnerability or breach npm's infrastructure. Instead, it compromised a maintainer's GitHub account and weaponized the trust relationships in the package dependency graph.

If your team pulls from npm without gating controls, you're exposed to the same attack vector that hit this ecosystem.

What Happened

The attack began with the compromise of developer Jared Wray's GitHub account. Despite using OpenID Connect (OIDC) with npm and one-time codes for GitHub authentication, the attacker gained access and pushed malicious code to packages under Wray's control.

The malware variant uses EtherHiding, a technique that uses the Ethereum blockchain for command and control communication. Once installed, the worm steals credentials from development environments and cloud service configurations, then spreads to downstream packages by compromising additional maintainer accounts.

The credential-stealing payload targets developer tools and cloud services, extracting API keys, session tokens, and authentication credentials from local environments.

Timeline

The public timeline remains incomplete, but the attack pattern follows a predictable sequence:

  1. Initial account compromise (method unconfirmed, but OIDC and one-time codes were in use)
  2. Malicious code pushed to packages controlled by the compromised account
  3. Automated propagation as infected packages were installed in other development environments
  4. Credential harvesting from infected environments
  5. Secondary account compromises using stolen credentials
  6. Expanded infection to 444 packages

The worm's self-propagating nature means the infection spread faster than manual incident response could contain it.

Which Controls Failed or Were Missing

No script execution gating. Development environments ran package install scripts without inspection or sandboxing. The malicious code executed with full privileges during npm install.

No minimum package age policy. Teams pulled newly-published package versions immediately, without waiting to observe community response or security scanning results.

Insufficient credential isolation. Developer workstations held production credentials or credentials with write access to critical infrastructure. When the worm harvested these, it gained lateral movement capability.

Missing dependency pinning and verification. Teams used version ranges (like ^1.2.0) instead of exact versions with hash verification, allowing automatic updates to compromised versions.

No behavioral monitoring for package scripts. Install scripts made network requests to blockchain nodes and exfiltrated credential files without triggering alerts.

Account security gaps. Despite OIDC and one-time codes, the initial account compromise succeeded. This points to either a weakness in the recovery flow, a session hijacking attack, or a compromise of the authentication provider itself.

What the Standards Require

PCI DSS v4.0.1 Requirement 6.4.3 mandates that public-facing web applications prevent attacks on business logic, including supply chain attacks that could compromise payment card data. For any team processing card data, this means you cannot blindly execute third-party code in environments with access to cardholder data.

OWASP Top 10 2021: A08 - Software and Data Integrity Failures specifically calls out software supply chain risks. The guidance requires integrity verification for components from untrusted sources and CI/CD pipelines that enforce security gates before deployment.

NIST 800-53 Rev 5 Control SA-12 (Supply Chain Protection) requires organizations to employ security safeguards to protect against supply chain threats. This includes verifying the integrity of software components and limiting damage from compromised components.

ISO/IEC 27001:2022 Control 8.30 (Outsourced Development) requires organizations to supervise and monitor the activity of outsourced development, which extends to open-source dependencies. You must verify that code from external sources doesn't introduce unacceptable risk.

The ChainDrop attack violated all of these controls. The worm executed arbitrary code without integrity verification, propagated through the supply chain without detection, and exfiltrated credentials without triggering security safeguards.

Lessons and Action Items for Your Team

Implement script gating immediately. Configure your package manager to block automatic script execution. For npm, use --ignore-scripts by default and explicitly allow scripts only after review. Yes, this breaks some packages. That's the point.

Enforce minimum package age policies. Don't install packages published within the last 72 hours unless you've manually verified them. Add this check to your CI/CD pipeline. A simple script can query the npm registry API and fail builds that depend on packages younger than your threshold.

Isolate credentials by environment. Your development workstations should never hold production credentials. Use short-lived tokens, credential vaulting, and separate service accounts for each environment. When a developer workstation is compromised, the blast radius should be limited to development resources.

Pin exact versions with hash verification. Replace version ranges with exact versions in your package-lock.json or equivalent. Better yet, verify package hashes using tools like npm audit signatures or integrate with a private registry that performs hash verification.

Monitor package install behavior. Deploy endpoint detection that alerts when package install scripts make unexpected network requests, especially to blockchain nodes or uncommon domains. This won't prevent the first infection, but it'll limit the dwell time.

Audit your authentication recovery flows. The initial compromise happened despite OIDC and one-time codes. Review your account recovery procedures, session management, and authentication provider configuration. If an attacker can bypass MFA through a recovery flow, your MFA is theater.

Scan for indicators of compromise. Check your npm cache directories for packages making blockchain requests. Search your credential stores for unexpected access patterns. Review your package.json files for dependencies you don't recognize.

The ChainDrop attack succeeded because it exploited the gap between how we think about supply chain security and how supply chain attacks actually work. Your action items should close that gap.

Ethereum blockchain

Topics:Incident

You Might Also Like