Skip to main content
Compromised npm Package Installed OpenClaw on 90,000 Weekly DownloadsIncident
4 min readFor Compliance Teams

Compromised npm Package Installed OpenClaw on 90,000 Weekly Downloads

What Happened

A threat actor compromised the Cline CLI package on npm and modified it to silently install OpenClaw—an AI coding agent—on developer machines without consent. The malicious version was live on the npm registry for eight hours before detection. During that time, any developer who installed or updated Cline CLI received the trojanized version.

OpenClaw itself isn't traditional malware. It's a legitimate AI agent downloaded 720,000 times weekly. However, its unauthorized installation created serious security risks: the agent has broad filesystem access, can execute commands, and connects to external services—all without the user's knowledge or permission.

Socket's research team discovered the compromise and reported it. The malicious package was removed, but the incident demonstrates how quickly supply chain attacks can spread through the npm ecosystem, especially when targeting popular developer tools.

Timeline

  • Hour 0: Attacker gains access to Cline CLI maintainer credentials or publishing rights
  • Hour 0-8: Compromised package version published to npm registry, begins auto-installing OpenClaw
  • Hour 8: Socket detects anomalous behavior and reports the package
  • Hour 8+: npm removes the malicious version from the registry

The eight-hour exposure window is significant. With approximately 90,000 weekly downloads of Cline CLI, the attack potentially reached thousands of developer machines before detection.

Which Controls Failed or Were Missing

Package signing and verification: npm does not require cryptographic signatures on packages. Any actor with publishing credentials can push code that will be trusted by default.

Pre-publication security scanning: The malicious package passed through npm's automated checks without triggering alerts for the unauthorized dependency installation.

Credential protection: The attacker obtained valid publishing credentials, suggesting either credential compromise or insufficient access controls on the maintainer's account.

Runtime behavior monitoring: Most development environments lack tools to detect when an npm package performs actions beyond its stated scope—like installing additional software.

Dependency pinning and lock files: Teams that didn't pin specific versions or review lock file changes may have automatically pulled the compromised version during routine updates.

Multi-factor authentication on package publishing: If the npm account lacked MFA, credential theft alone would grant full publishing access.

What the Relevant Standards Require

PCI DSS v4.0.1 Requirement 6.3.2 mandates that custom software be developed based on industry standards and incorporate information security throughout the software development life cycle. For teams in PCI scope, this includes your build toolchain. An npm package that silently installs third-party agents violates the principle of controlled, reviewed changes to the development environment.

ISO/IEC 27001:2022 Control 8.30 (Outsourced development) requires organizations to supervise and monitor outsourced system development. When you install an npm package, you're outsourcing code to that package's maintainers. The control requires you to verify the integrity of that code—something impossible when packages can be modified post-publication without cryptographic verification.

NIST 800-53 Rev 5 Control SA-12 (Supply Chain Protection) explicitly addresses this scenario. It requires organizations to employ integrity verification tools and techniques to detect unauthorized changes to software. The control also calls for limiting the harm from supply chain compromise through techniques like least privilege and monitoring.

SOC 2 Type II CC6.8 (Logical and Physical Access Controls) requires that the entity restricts software to prevent unauthorized access. An npm package that installs additional software without authorization directly violates this control. During a SOC 2 audit, you'd need to demonstrate that your development environment has controls preventing such installations.

NIST CSF v2.0 Function: Identify, Category ID.RA (Risk Assessment) requires ongoing assessment of supply chain risks. This incident represents exactly the type of third-party risk that should appear in your risk register, with documented mitigations.

Lessons and Action Items for Your Team

Implement package signature verification. Move to a package manager or registry that supports cryptographic signing. For npm specifically, configure your environment to reject unsigned packages or packages from unverified publishers. Tools like Sigstore can provide signing infrastructure.

Deploy supply chain security scanning. Use tools like Socket, Snyk, or GitHub's Dependency Review to scan packages before installation. Configure these tools to flag:

  • Packages that install additional dependencies post-installation
  • Packages with filesystem access beyond their stated purpose
  • Packages making network requests to unexpected domains
  • Recently published versions from previously dormant packages

Pin all dependencies and review lock file changes. Your package-lock.json or yarn.lock should be committed to version control. Treat any change to these files as a code change requiring review. A sudden version bump without a corresponding pull request should trigger investigation.

Require MFA on all package publishing accounts. If your team publishes packages, enforce MFA on npm, PyPI, or other registries. Use hardware security keys where possible, not SMS-based MFA.

Isolate build environments. Run npm installs in containerized or sandboxed environments that limit filesystem and network access. Your CI/CD pipeline should not run with the same permissions as production systems.

Monitor for unexpected installations. Deploy endpoint detection tools that alert when developer machines install software outside approved channels. OpenClaw's installation should have triggered an alert for an unexpected binary appearing in the user's home directory.

Create an approved package list. For critical projects, maintain an allowlist of vetted packages. New dependencies require security review before approval. This adds friction but prevents automatic ingestion of compromised packages.

Test your incident response. This attack was detected within eight hours by a third party. Could your team detect it independently? Run a tabletop exercise: a developer reports "something installed on my machine after npm install." What's your response process?

The Cline CLI compromise wasn't sophisticated—just effective. The attacker didn't exploit a zero-day or break encryption. They compromised credentials and used npm's trust model against its users. Your defense needs to assume that any package, at any time, could be compromised. Build your controls accordingly.

Topics:Incident

You Might Also Like