Eslam Hamed
Technical Lead & AI Solutions Architect
Building enterprise AI systems, cloud platforms, and production-ready software
Clinejection: How an Issue-Triage Bot Put Cline's npm Token Within Reach
On February 17, someone used a compromised npm token to publish version 2.3.0 of Cline's command-line tool. The release changed one thing: an install script that, with npm's default settings, also installed OpenClaw, the open-source personal agent, as a global package. Eight days earlier, the security researcher Adnan Khan had published how anyone with a GitHub account could steer the AI bot that answered Cline's GitHub issues, and use it to reach the secrets of Cline's release pipeline. Khan called it Clinejection. The question is whether that bot is how the token got out, and what anyone running an AI step in CI should take from it.
I went through Cline's advisory and its post-mortem of February 24, Khan's write-up and the Cline messages it reproduces, the removed workflow, the npm registry, the GitHub Action's documentation, and what security firms and Microsoft reported. The short answer: the path from an issue title to the release secrets is well documented, and Cline's post-mortem now describes it the same way Khan did. The token used on February 17 was one Cline meant to revoke on February 9 and did not. Who took it, and when, rests on independent researchers' accounts; Cline names no one. The harm was small. The design failure was not.
What happened
Cline is an open-source AI coding agent. Most people run it as an editor extension, which Cline said on January 30 had passed five million installs; there is also a command-line version on npm. On December 21, 2025, Cline added a GitHub Actions workflow that ran Claude Opus 4.5 through Anthropic's claude-code-action on every new issue, to post a first reply and add labels.
Three settings in that workflow file made it an open door. allowed_non_write_users let anyone trigger it, not only people with write access to the repository. The model was given a shell, file-editing tools and web access. And the issue's title was pasted straight into the prompt. The authors did expect prompt injection. The job's GitHub token could read the repository and write to issues, and a comment above the tool list explains the choice: "security is enforced by GitHub permissions above".
Khan's point is that the token was never the boundary. In Khan's example, an issue title posing as a tool error tells the bot to install a package from the attacker's commit, whose install script runs before the model can look at it. Any job that can run code can also write to the repository's GitHub Actions cache, whether it uses caching or not, and every workflow on the default branch shares that cache. Cline's nightly release workflows restored cached dependencies, and they held the publishing tokens for the VS Code Marketplace, OpenVSX and npm. Since a GitHub change in November 2025, Khan explains, a job that fills the cache past 10 GB can push out the real entries at once and leave its own under the same names. The next nightly build restores the planted entry and runs the attacker's code beside the secrets. And a nightly token was as good as a release token, because the same publisher identity and the same npm package served both.
What is documented
In date order, from the workflow file, the registry, Cline's advisory and post-mortem, and Cline's messages to Khan as published in Khan's write-up:
- December 21, 2025. The triage workflow is added to Cline's repository.
- January 1, 2026. Khan reports the flaw through GitHub's private vulnerability reporting and emails Cline's security address. By Khan's account, follow-ups on January 8, January 18 and February 7 got no substantive reply.
- January 31 to February 3. Cline's nightly release jobs fail in a way that, Khan says, matches the trace of Khan's own open-source cache-poisoning tool. Khan took it as a sign someone had already poisoned the cache.
- February 9. Khan publishes. Within the hour by Khan's account, and within 30 minutes by Cline's, Cline merges a change that deletes the triage workflow and two AI review workflows, removes caching from four publishing workflows, and starts rotating credentials.
- February 10. An anonymous sender emails Khan claiming to hold working npm and OpenVSX credentials for Cline. Khan forwards it to Cline.
- February 11. Cline replies that every publication credential has been rotated and the old tokens no longer work, and that an audit found no unauthorised release up to February 9.
- February 17, 3:26 a.m. Pacific. cline@2.3.0 is published with an npm account's token, not through GitHub Actions, and without the provenance record every release since February 10 had carried. Its only change is the install script. The CLI itself is identical to 2.2.3.
- February 17, 11:23 to 11:30 a.m. Cline publishes 2.4.0, deprecates 2.3.0 and revokes the token. Its advisory rates the incident low severity and says the VS Code extension and the JetBrains plugin were not affected.
- February 17, in a correction to Khan. Cline writes: "The wrong token was deleted, and the exposed one remained active."
- February 18. Khan adds that the proof of concept ran on a mirror, and that a different actor found it there and used it against Cline.
- February 24. Cline's post-mortem names the triage bot and the shared cache as the path to its publishing secrets and explains how the npm rotation failed.
What each claim going around rests on:
| Claim | What the record shows | What it does not show |
|---|---|---|
| Anyone could steer the bot | The workflow's settings, Khan's tests on a mirror, and Cline's post-mortem, which calls it a prompt injection vulnerability | Which issue was used against Cline. Cline does not say |
| The token leaked through the bot | Cline's post-mortem describes this chain as the path to its secrets, as Khan and Bargury did | Who took the token, or when. Cline names no one; the late-January date is Bargury's alone |
| Cline rotated its credentials | It did on February 9, deleted the wrong npm token, and checked a dashboard that did not list the live one | When the token was first taken |
| Cline used trusted publishing | Every release Cline published from February 10 had provenance | Token publishing switched off before February 17. Cline says it is now |
| Malware reached millions | About 4,000 downloads of the CLI in eight hours, by StepSecurity's count | The editor extension affected, or OpenClaw running once installed |
What Cline says, and what changed
Cline's advisory of February 17 covered the publish and the clean-up but not how the token was obtained. In a message to Khan on February 10, Cline said its production release flows required maintainer approval, which reduced exposure. Khan's chain never touched those flows: it went through the nightly workflows, whose tokens could publish production releases too, and 2.3.0 went out as a regular release.
The post-mortem of February 24 agrees with Khan on the main points. Its description of the vulnerability is Khan's chain, step for step. It confirms that Khan's January report went unaddressed until the public disclosure, and credits Khan with finding indicators of compromise in the nightly workflows. It also explains why the clean-up failed. The Marketplace and OpenVSX tokens were rotated on February 9, but for npm the wrong token was deleted, and Cline checked its work on npm's organisation-level token page, which showed zero active tokens and did not list the exposed one. It calls the publisher a third party and says nothing about who that was or when the token was taken.
Some of it I cannot check. Cline says it audited every release on all four of its channels from December 21 to February 17, compared each npm tarball file by file with the source, found no unauthorised commits, and that no user data was read or taken. One claim conflicts with another account: the anonymous sender of February 10 said the OpenVSX credentials still worked, while Cline says those were rotated successfully the day before and nothing unauthorised was published there.
The changes it lists answer each failure. The AI triage workflows are gone, and any future automation is to be read-only with no shell. Workflows that handle publishing credentials no longer use the cache. npm publishing goes only through GitHub Actions with OIDC, and no long-lived npm token remains. A rotation now has to be verified against the credential itself, by testing revocation and matching fingerprints, not only on a dashboard. Cline says it is also setting up a disclosure process with defined response times and having outside firms audit its CI/CD. Its own conclusion is that a model with a shell, reading untrusted input in CI, amounts to a shell for every GitHub user.
The registry adds one detail: Cline did not wait for the incident to adopt trusted publishing. From February 10, every release Cline itself published came from GitHub Actions with a provenance record. The long-lived token kept working anyway, and on February 17 someone used it to publish around the new pipeline. Henrik Plate of Endor Labs drew the lesson the next day: switch off token publishing as well as switching on trusted publishing, which npm's own documentation recommends. StepSecurity and Endor Labs say they flagged 2.3.0 because the provenance record vanished and the publisher changed, StepSecurity within about a quarter of an hour of publication.
What the record does not support
- Millions of developers hit. The five million installs belong to the editor extension, which Cline says was not affected. For the CLI, StepSecurity counted about 4,000 downloads of 2.3.0 before it was deprecated. A download is not a machine: CI runs and repeat installs count too. Microsoft said Defender had picked up a small but visible rise in OpenClaw installs started by the Cline CLI's install script, which shows that real installs happened, not how many.
- A backdoor on every machine. OpenClaw is a legitimate project, the one whose gateway takeover and malicious skills I wrote about earlier this month. Cline says it poses no security risk. StepSecurity called it a high-value implant that installs a persistent background service; Endor Labs and Socket say a plain npm install does not start that service. I found nothing showing OpenClaw doing anything on a machine beyond being installed. That is not a defence: an agent with broad system access arrived without consent, and the same token could have shipped anything.
- Khan as the culprit. Khan says the proof of concept ran on a mirror under Khan's own test accounts, and Cline credits Khan with finding and reporting the flaw. An independent analysis by Michael Bargury traces the attack on Cline's repository to an issue opened in late January by another account, named to look like GitHub's own automation and since removed, and judges it a bug-bounty-style demonstration, not a criminal campaign. That is one analyst's reading. The Register said on February 20 that it did not know who was responsible.
- Bad luck with the model. Khan's tests used the model Cline's workflow ran, and it followed the planted instruction every time. Any model that reads instructions will sometimes follow the wrong ones. This one had a shell.
An agent problem, not a Cline problem
None of the pieces is new, as Khan and Cline both say: prompt injection, Actions cache poisoning and credential theft are all well documented. What was new was the way in: a sentence any stranger can write, read by a model with a shell, next to a cache the release pipeline trusted. Cline's workflow relied on the token's scope and the model's judgement, and neither was the boundary. I design AI platforms and conversational workflows for enterprise deployments at DXWand, and the same rules apply there. Each would have broken this chain somewhere.
- Treat content as data. An issue title is input from a stranger. Pasted into the prompt beside the instructions, it reads like one of them. A separate, labelled field helps a little. It does not make a model with a shell safe.
- Least privilege means tools, not only tokens. Triage needs to read an issue and post a reply. It does not need a shell, file editing or the web. The job's token was narrow, but the job also had code execution on a runner, write access to the shared cache and an Anthropic API key. The action's own security notes call letting non-writers trigger it "a significant security risk", fit only for workflows with extremely limited permissions. Cline's token met that bar. Its tool list did not, and a shell is a permission.
- Separate reading from acting. Let the model read the issue and propose labels and a reply as structured output, and let a fixed step with no model in it apply them. The model can be talked into anything. The fixed step cannot.
- Enforce trust boundaries below the model. Half of Cline's fix had nothing to do with AI: the publishing workflows stopped restoring the cache. A release job should trust nothing a lower-trust job could have written.
- Verify the revocation, not the rotation. Cline rotated on February 9, checked a token page that showed nothing active, and told Khan it was done. The old token published a release eight days later. A rotation is finished when the old credential has been tried and refused, which is now Cline's rule too.
- Keep the evidence, and read it. The trace Khan found was in Cline's own job logs. Khan says the team adjusted the pipeline to tolerate the failures instead of investigating them. An unexplained failure in a release job is a security event until shown otherwise.
If you run an AI step in CI
- List every workflow that runs a model on something outsiders can create: issues, comments, pull requests from forks. Read each one's tool list. A shell in it is the finding.
- Check who can trigger it. In claude-code-action that is
allowed_non_write_users; leave it empty unless the job can do nothing but read and comment. - Build release jobs clean, without the Actions cache, and publish nightly builds under a separate identity and package name.
- Turn on trusted publishing, then turn off token publishing, then list the tokens on every account that can publish and delete the ones nothing uses.
- If you depend on a package that has carried provenance, treat a release without it as suspect, and consider installing CLI tools in CI with install scripts disabled.
- If you installed cline@2.3.0, update to 2.4.0 or later and remove OpenClaw if you did not mean to have it, as Cline's advisory says.
Where that leaves it
Cline's users got off lightly: an unwanted but legitimate program, about 4,000 downloads by one firm's count, an advisory the same day and a candid post-mortem a week later. The chain behind it was not light. A stranger's sentence reached a model with a shell, the shell reached a cache, and the cache reached the release secrets. Cline closed the hole within half an hour of it going public, by its own account, more than five weeks after it was reported, and then left one key in the lock. No step needed a new technique. The bot just made the first one free.
Putting agents near real systems and data? I help teams design the controls before something goes wrong. See how we can work together.