Cline CLI npm Package Compromised via Suspected Cache Poisoning Attack

A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.

  • Sarah Gooding
5 min read
Cline CLI npm Package Compromised via Suspected Cache Poisoning Attack

On February 17, 2026, an unauthorized party used a compromised npm publish token to push cline@2.3.0 to the npm registry. Cline is a popular AI coding agent CLI in the developer ecosystem, with around 90,000 weekly downloads from npm. The malicious version contained a modified package.json with an added postinstall script: npm install -g openclaw@latest. It sat live on the registry for approximately eight hours before Cline deprecated it and published a corrected version, 2.4.0.

Socket scans every package version published to npm continuously, before most users ever have the chance to update. When cline@2.3.0 hit the registry, we flagged it for an install script. Cline had no prior install scripts, so a new one appearing was an anomalous signal worth investigating. After seeing Cline's GHSA confirming the token had been compromised, we marked the version as malware today. The malware classification reflects the mechanism, an unauthorized publish via a compromised token, not the payload itself.

cline@2.3.0 Contained a Postinstall Script to Globally Install openclaw

#

The only modification to cline@2.3.0 was the postinstall script. The CLI binary and all other package contents were identical to the legitimate prior release. The script installs openclaw, a legitimate open source AI assistant project, globally on the user's machine.

Openclaw itself isn't malicious, but it's a pretty significant piece of software to have globally installed without your knowledge or consent. It runs a local gateway daemon with broad system access, browser control, and integrations with messaging platforms including WhatsApp, Telegram, Slack, Discord, and iMessage. Just having it installed doesn't activate it. Users who didn't notice it or run it are not at ongoing risk but the GHSA advisory recommends uninstalling it if you're affected: npm uninstall -g openclaw.

The payload was non-malicious in the sense that nothing ran automatically beyond the install, but openclaw is a capable agentic tool with broad system permissions, not a trivial package to have silently dropped onto a developer's machine.

npm Token Compromised via Suspected Cache Poisoning Attack

#

To understand how an attacker got hold of Cline's npm publish token, you need to read security researcher Adnan Khan's post, Clinejection: Compromising Cline's Production Releases Just by Prompting an Issue Triager. It is an exceptional piece of security research and we strongly recommend reading it in full.

Khan is no stranger to this attack vector. Socket previously covered his work on GitHub Actions cache poisoning when it was used to compromise the Ultralytics PyPI package in 2024, and he has extensively documented how effective the technique can be against misconfigured CI/CD pipelines.

The short version: Cline had added an AI-powered GitHub Actions workflow that automatically triaged incoming issues using Claude. The workflow was configured to allow any GitHub user to trigger it simply by opening an issue, and it gave Claude access to a broad set of tools including arbitrary Bash execution. Because the issue title was interpolated directly into Claude's prompt, an attacker could craft a title containing instructions that would trick the model into running arbitrary commands (a prompt injection attack).

From there, the researcher documented a full attack chain: code execution in the triage workflow, GitHub Actions cache poisoning to evict legitimate cache entries and replace them with malicious ones, and a pivot to the nightly release workflow, which consumed from the cache and had access to publication tokens. Because Cline used the same publisher identity for nightly and production releases on npm, the OpenVSX registry, and the VS Code Marketplace, a nightly token was effectively equivalent to a production token.

Khan also documented what appeared to be evidence of actual exploitation: suspicious cache poisoning activity and anomalous post-checkout step failures in Cline's nightly workflow between January 31 and February 3, weeks before the February 17 publish. Whether that activity and the eventual token compromise are directly connected isn't confirmed, but the timing is notable.

Khan Reported the Vulnerability Six Weeks Before the Exploit

#

Khan warned about this vulnerability six weeks before the exploit happened. He submitted a detailed private vulnerability report on January 1, 2026, via GitHub's private vulnerability reporting system. He also emailed Cline's security contact. He followed up on January 8, after another researcher tried to flag it in Cline's Discord. He attempted to reach Cline's CEO directly on X on January 18. He sent a final email on February 7. He received no substantive response through any of these channels.

Khan published his research publicly on February 9. Cline fixed the vulnerable workflow within 30 minutes of public disclosure. The exploit happened eight days later.

Patching the workflow closed the entry point, but if the npm token was already stolen during the suspected January reconnaissance activity, the fix came too late to prevent the February 17 publish.

The researcher did everything right. He found a critical vulnerability, reported it responsibly through multiple channels, waited nearly six weeks, and went public only after exhausting every option. The fix that took 30 minutes after public disclosure could have happened in January. The token rotation and switch to OIDC provenance that Cline implemented after the February 17 compromise could have happened earlier as well.

Security depends on researchers being willing to find and report these issues. It also depends on companies being willing to receive and act on those reports. When reports get ignored, researchers face a choice between staying silent indefinitely, leaving users exposed, or going public. The Clinejection case is a good example of why researchers publishing their findings can force projects to prioritize security reports, when communication attempts across private channels are ignored.

The attacker had the ability to install anything. This time it was openclaw. Next time it might be something malicious.

"The individual components of this attack are not new," Khan said in his Clinejection research post. "Prompt injection, Actions cache poisoning, and credential theft are well-documented techniques. What makes this dangerous is how they compose: AI agents with broad tool access create a low-friction entry point into CI/CD pipelines previously only reachable through code contributions, maintainer compromise or traditional poisoned pipeline execution."

If You Installed cline@2.3.0

#

If you installed or updated the Cline CLI during the approximately eight-hour window on February 17, 2026:

  • Update to the latest version: npm install -g cline@latest
  • Verify you're not on 2.3.0 (the only impacted version). If you are, update to 2.4.0 or higher: cline --version
  • Check for and remove openclaw if you didn't intend to install it: npm uninstall -g openclaw
Stay ahead of threats

Subscribe to our newsletter

Get notified when we publish new security blog posts!