Skip to content
konsole
Threat intelligence

Threat report · Supply chain · Agents

Attacks through the AI toolchain: worms that weaponise coding agents, poisoned MCP servers, and intrusions run by AI, 2025 to 2026

A sourced report on the AI software supply chain under attack: npm worms that turn installed Claude Code, Gemini CLI and Amazon Q into secret hunters, backdoored MCP servers and IDE extensions, remote-code-execution flaws in Cursor, Copilot, Gemini CLI and Claude Code, and the vendor threat reports that document AI agents running intrusions end to end.

Konsole threat research 17 min read

THREAT INTELLIGENCETRACKINGAttacks through the AI toolchainPackages that weaponise installed coding agentsBackdoored MCP servers and IDE extensionsIntrusions run end to end by an AI agentDATED · SOURCED · MAPPED TO CONTROLS

The AI toolchain is a supply chain like any other, with two differences. First, its components run with the developer’s full privileges and are designed to act on text: an agent that reads a file will do what the file says. Second, its credentials are unusually valuable, because a stolen model API key is simultaneously loot, free compute and a way to hide the attacker’s own AI use behind someone else’s account. The incidents below show attackers working out both facts within a few months of each other.

STEP 1Compromised packageSTEP 2postinstall runsSTEP 3Finds local AI CLISTEP 4Agent hunts secretsSTEP 5Pushes to public repoTHE AGENT IS THE TOOL THE ATTACKER DID NOT HAVE TO BRING
The pattern first seen in the nx compromise of August 2025 and repeated in every major npm worm since. The agent the victim installed for productivity does the attacker’s searching.

Package worms that weaponise installed coding agents

Amazon Q extension, July 2025: the warning shot

A pull request to the open-source Amazon Q Developer extension for VS Code, from an account with no history, was merged and shipped in version 1.84.0. It downloaded a prompt and fed it to the Amazon Q command-line agent with all tool approvals disabled, instructing it to “clean a system to a near-factory state” by deleting files and cloud resources. The payload appears not to have worked. Amazon said no customer resources were affected and shipped 1.85.0 within days. The extension had roughly 950,000 installs. It was the first public case of an attacker using an AI agent as the execution engine for destructive intent. [1][2]

nx and “s1ngularity”, August 2025: the pattern is set

On 26 August 2025 malicious versions of nx, a build tool with about 4.6 million weekly downloads, were published with an npm token stolen through a misconfigured GitHub Actions workflow. The post-install script harvested environment variables, SSH keys, npm and GitHub tokens and cryptocurrency wallets. Then it did something no package malware had done before: it looked for Claude Code, Gemini CLI and Amazon Q on the machine, launched whichever it found with the flags that skip permission prompts, and gave it a prompt asking it to enumerate files likely to contain secrets. The results were pushed to public repositories in the victim’s own GitHub account. Two days later the stolen GitHub tokens were used to flip victims’ private repositories to public. GitGuardian counted 2,349 leaked secrets in the first phase and 10,767 repositories exposing a further 82,901 secrets in the second; Wiz put the exposed repositories at around 5,500 and noted that where an AI CLI was present the AI-driven search succeeded in fewer than a quarter of cases. The agents were, for once, not very good at the job. They would get better. [3][4][5][6]

Shai-Hulud, September and November 2025

The first Shai-Hulud wave began on 15 September 2025 with a popular colour library and spread by using each victim’s stolen npm token to republish trojanised versions of up to twenty of their own packages. CISA counted more than 500 affected packages. The second wave, from 21 November, was larger and nastier: it installed the Bun runtime to evade monitoring aimed at Node, harvested cloud credentials from AWS, GCP and Azure including instance metadata and secret stores, registered a self-hosted GitHub Actions runner as a command channel, republished up to a hundred of each victim’s packages, and wiped the home directory if it found no token to steal. Datadog counted 796 packages and 1,092 versions with more than 20 million combined weekly downloads, data from more than 500 GitHub users and 150 organisations, and over 14,000 exfiltration repositories. [7][8][9][10]

2026: the worm goes open source and the agents become the target

In February 2026 Socket found SANDWORM_MODE, a set of typosquatted packages (including misspellings of Claude Code) that wrote a fake MCP server to disk and registered it in the configuration files of Claude Code, Claude Desktop, Cursor, Continue and Windsurf. Its tool descriptions contained instructions telling the assistant to read SSH keys, cloud credentials and environment files. The agent was not exploited; it was given a new tool and trusted it. [11][12] In March the group tracked as TeamPCP used un-rotated credentials to poison 76 of 77 tags of the trivy-action security scanner (CVE-2026-33634), stole the publishing credentials for Checkmarx and LiteLLM through it, and shipped malicious LiteLLM releases carrying a credential stealer that specifically collected AI-provider API keys; CloudSEK estimated more than 2,500 organisations and about 434,000 CI runs exposed. [13][14][15] In April a compromised GitHub Action put a stealer into Bitwarden’s CLI release for about ninety minutes; Bitwarden said vault data was unaffected. [16][17] In May TeamPCP published the worm’s source code, and copycats followed within days; a June PyPI campaign called Hades stole Claude and MCP configurations alongside cloud tokens. [18][19][20] In July GitHub shipped npm 12 with dependency install scripts disabled by default, the first registry-level change aimed squarely at this family. [21] The ChainDrop worm of August 2026 still reached between 444 and 868 packages through a compromised maintainer account. [22][23]

October to November 2026: the agent’s own files as the weapon

The MALFEX campaign, found on a customer machine by Forever Security and analysed by CloudSEK and Checkmarx, dropped an AGENTS.md file into the Downloads folder from a web page. If a developer later launched a coding agent in that folder, the file, styled as ordinary engineering notes, told the agent to add a server to its own configuration and install a malicious package. OpenAI’s Codex followed the instructions in more than 90% of tests; a CLAUDE.md variant that pointed Claude Code at an attacker-controlled API endpoint succeeded less often. No vendor shipped a patch, because the agents were behaving as designed. [24][25] In November Google’s threat intelligence group reported a North Korea-linked actor, MIDNIGHT NEPTUNE, using modified Claude Code settings files that download a backdoor every time the agent starts: the agent’s hook system as a persistence mechanism. [26]

MCP servers: the first backdoor and the ecosystem’s numbers

The Model Context Protocol gives agents tools, and tools run code. In September 2025 Koi Security found the first malicious MCP server in the wild: an npm package impersonating Postmark’s email server shipped fifteen clean versions and then, in version 1.0.16, added one line that blind-copied every email the agent sent to an attacker’s address. It had about 1,500 weekly downloads. Postmark confirmed the package was not theirs. [27][28]

Two critical flaws in the plumbing came earlier. CVE-2025-6514 in mcp-remote (CVSS 9.6) let a malicious or intercepted MCP server return a crafted OAuth endpoint that was executed as a command when the client opened the browser; about 437,000 downloads were exposed before the fix. CVE-2025-49596 in Anthropic’s own MCP Inspector (CVSS 9.4) had no authentication between its web interface and its proxy, so visiting a web page could execute code on the developer’s machine; it was fixed in version 0.14.1. [29][30][31]

MeasurementFigureSource and date
Public MCP serversMore than 10,000 active (Anthropic, Dec 2025); third-party registry snapshots grew from about 9,650 in May 2026 to about 52,000 in October 2026. Listings are not vetted.Anthropic; registry censuses [32][33]
Popular MCP implementations with command injection, SSRF or path traversal43%, 30% and 22% respectively (sample size not disclosed)Equixly, Mar 2025 [34]
Most-starred MCP servers with at least one risk finding29% of about 8,000; six allowed unintended remote code executionBackslash Security, 2025 [35]
Internet-exposed MCP servers1,862 found; all 119 manually verified exposed tool listings without authenticationKnostic, 2025 [36]
Secrets in public MCP configuration files24,008, of which 2,117 still validGitGuardian, Mar 2026 [37]

Code execution through the agents themselves

The agents’ vendors spent 2025 and 2026 patching a steady run of flaws with the same shape: content the agent reads, or a file in the repository it opens, causes it to run commands or change its own permissions without the user approving. The configuration file is the recurring target, because an agent that can write its own settings can grant itself anything.

ProductFlawMechanismFixed
CursorCurXecute, CVE-2025-54135 (CVSS 8.6); MCPoison, CVE-2025-54136A Slack message read via MCP made the agent write the MCP config, which ran before approval; an approved config could be silently edited and re-runCursor 1.3, Jul 2025 [38][39]
CursorCVE-2026-22708, CVE-2026-26268, DuneSlide CVE-2026-50548/50549 (CVSS 9.8)Allow-list bypass via shell built-ins; git hooks written outside the sandbox; working-directory and symlink sandbox escapesCursor 2.3, 2.5 and 3.0, Jan to Jul 2026 [40][41]
GitHub CopilotCVE-2025-53773 (CVSS 7.8)Injected content made the agent set its own auto-approve flag in the workspace settings, then run commands; wormable through committed settingsAug 2025 Patch Tuesday [42]
Gemini CLITracebit findingA GEMINI.md file plus an allow-list parsing bug: once grep was approved, a chained command exfiltrated environment variables while the UI showed only grepv0.1.14, Jul 2025 [43][44]
Gemini CLICVE-2026-12537 (CVSS 10.0)Headless mode auto-trusted workspaces and the yolo flag ignored allow-lists, so a public GitHub issue could execute code in CI with write credentials0.39.1 and run-gemini-cli 0.1.22, Apr 2026 [45][46]
Claude CodeCVE-2025-59536 (CVSS 8.7); CVE-2026-25725Project code ran before the trust dialog was accepted; the sandbox did not protect a missing settings file, so sandboxed code could plant hooks that run on the host1.0.111, Oct 2025; 2.1.2, Feb 2026 [47][48][49]

Two of these matter beyond their CVSS scores. The Gemini CLI flaw of April 2026 and the Cline compromise of February 2026 (covered in the prompt-injection report) both show that an agent running in CI with write credentials turns every public issue tracker into an attack surface. And the Copilot and Claude Code findings show the agents’ permission systems being defeated by the agent writing its own permission file, which is a category of flaw that will recur as long as settings live where the agent can reach them.

The other direction: intrusions run by AI

The vendors who run the models have the best view of attackers using them, and their reports between August 2025 and November 2026 trace a steep curve.

  • August 2025, Anthropic. A single operator used Claude Code for nearly every stage of a data-extortion campaign against at least seventeen organisations in healthcare, emergency services, government and defence: reconnaissance, credential harvesting, network penetration, choosing what to steal, pricing ransoms from stolen financial data (demands above US$500,000) and writing the ransom notes. Anthropic called it “vibe hacking”. [50]
  • November 2025, Google. PROMPTSTEAL, used by the Russian group APT28 against Ukraine, was the first malware observed querying a model (an open-weight Qwen coder via Hugging Face) at runtime to generate the commands it ran. QUIETVAULT, a JavaScript stealer, used locally installed AI CLIs to hunt for additional secrets, the nx pattern adopted by a conventional malware family. [51]
  • November 2025, Anthropic, GTG-1002. A Chinese state-sponsored group built an orchestration framework around Claude Code and MCP-connected scanners and password crackers, and ran a campaign against about thirty targets with the AI performing an estimated 80 to 90% of tactical work and humans intervening at four to six decision points. The operators jailbroke the model by splitting the work into innocuous tasks and posing as a penetration-testing firm. Anthropic described it as the first reported AI-orchestrated espionage campaign; independent researchers disputed the autonomy estimate, and the model’s habit of inventing credentials limited its success. [52][53][54]
  • 2025 to 2026, OpenAI. Four reports disrupted more than forty networks in total, from Russian-speaking developers refining credential stealers to Chinese accounts building surveillance tooling, and concluded that the models gave actors incremental efficiency rather than new capability. [55][56]
  • May to October 2026, Google. The first AI-developed zero-day Google had identified (a two-factor bypass in an open-source administration tool); an Android backdoor driving the device’s interface through a small Gemini model; a Claude Code skill packaged with 85,000 historical vulnerability write-ups; and ARTEX, an open-source offensive framework of six sub-agents used by extortion groups and a China-nexus actor to go from first account to deep access in about four hours. [57][58]
  • September 2026, Anthropic. A Russian state-nexus group used Claude Code skills across development, phishing and exfiltration, with agents rewriting their malware when it was flagged, and took 300,000 national identity records from a government authority. A ShinyHunters affiliate ran a pipeline that decompiled 1.8 million Android apps looking for secrets and reused stolen AI API keys for three weeks. Another group attacked about thirty AI companies in four days by injecting instructions into a vendor’s evaluation sandbox to steal production keys. Anthropic’s framing of stolen keys: “loot, compute and cover”. [59][60]
  • November 2026, Google. The first observed fully automated vulnerability discovery and exploitation with no human in the loop; zero-days averaging eleven a month in 2026 against eight in 2025; and LLMjacking losses above US$100,000 a day, in the worst cases through a LiteLLM gateway flaw (CVE-2026-40217) that turned a virtual key into administrator access. Google’s assessment was that fully autonomous attacks were three to six months away. [26][61]

What the standards bodies and governments have said

OWASP published its Top 10 for Agentic Applications on 9 December 2025 with more than a hundred contributors. Four of its ten entries describe the incidents above directly: ASI02 Tool Misuse, ASI04 Agentic Supply Chain Vulnerabilities, ASI05 Unexpected Code Execution and ASI06 Memory and Context Poisoning. [62][63] On 30 April 2026 CISA, the NSA, and the cyber-security agencies of the UK, Australia, Canada and New Zealand jointly published “Careful Adoption of Agentic AI Services”, which recommends least privilege for agents, starting with low-risk use cases, and folding agents into existing governance rather than treating them as a new category. [64][65]

The controls that map to each failure

FailureControlWhere it lives
A worm runs the installed agent with permissions disabledAgents call models only through a gateway that holds the keys; a local process with no provider key cannot exfiltrate through the model, and the gateway logs the attemptGateway (architecture)
Model API keys on developer machines are stolen and resoldKeys vaulted centrally; developers hold short-lived tokens scoped to a model and a budget; secrets scanning on every repository and MCP configGateway (platform) and CI
A malicious MCP server or tool description instructs the agentAllow-list MCP servers by hash and publisher; inspect tool descriptions and tool arguments at the gateway as untrusted inputGateway (firewall) and policy
Agent configuration files are written by the agent or by a packageKeep agent settings under version control with review; deny agents write access to their own settings and hook directories; alert on changesEndpoint and repository policy
Agents in CI act on public issues and commentsNo write credentials for agents triggered by untrusted events; OIDC trusted publishing; separate the triage agent from the release pipelineCI configuration
Install scripts run on npm installnpm 12 or later with install scripts disabled; lockfile pinning; a delay before adopting new versionsDeveloper tooling

Frequently asked questions

How did the nx attack use Claude Code and Gemini CLI?
The malicious post-install script checked for the agents on the victim’s machine, launched whichever it found with the command-line flags that disable permission prompts, and passed a prompt asking the agent to list files likely to contain credentials, keys and wallets. The agent did the searching; the script uploaded the results to a public repository in the victim’s own GitHub account.
Was the first malicious MCP server a hack of Postmark?
No. It was an npm package pretending to be Postmark’s MCP server. It behaved correctly for fifteen versions, then added a single line that copied every outgoing email to an attacker. Postmark confirmed it was not theirs. The lesson is about provenance: an MCP server is code you run with your credentials, and a name on a registry proves nothing.
Why do so many of these flaws involve the agent’s configuration file?
Because the configuration file is where the agent’s permissions live. If content the agent reads can make it write that file (CurXecute, Copilot CVE-2025-53773, Claude Code CVE-2026-25725, MALFEX, MIDNIGHT NEPTUNE), the agent grants itself what the attacker wants. Treating agent settings as code under review, and denying the agent write access to them, closes the category.
Did an AI really run a cyber-espionage campaign on its own?
Anthropic’s November 2025 report says the AI performed an estimated 80 to 90% of the tactical work in the GTG-1002 campaign, with humans making four to six decisions per target. Independent researchers questioned the figure, and the model’s tendency to invent credentials limited its effectiveness. By November 2026 Google reported exploitation with no human in the loop at all.
What should a team do first?
Get provider keys off developer machines and out of CI environment variables. Route every agent and app through a gateway that holds the keys, issues short-lived scoped tokens, caps spend and logs calls. Then pin and review agent configuration files, disable npm install scripts, and give CI agents no write credentials when they act on public input.

Key takeaways

  • Assume any package install can run your coding agent with its safeguards off. Keep the model key somewhere the agent cannot read it.
  • Treat MCP servers, tool descriptions and agent config files as untrusted code. Pin, review and alert on changes.
  • Agents in CI must not hold write credentials when they act on public issues or comments.
  • Stolen model keys are loot, compute and cover. Scope every key to a model and a budget, and watch for one-token probe requests.
  • The attackers’ agents improved from failing three-quarters of the time (nx, Aug 2025) to running campaigns unattended (Nov 2026) in fifteen months. Plan for that curve.

Sources

Numbers in square brackets in the text refer to this list. Links open the publisher’s page.

  1. [1]Amazon Q AI prompt: wiper instruction shipped in VS Code extension · The Register · 24 Jul 2025
  2. [2]Amazon Q VS Code extension compromised with malicious code · JFrog Security Research · Jul 2025
  3. [3]nx packages compromised · Socket · 26 Aug 2025
  4. [4]s1ngularity’s aftermath · Wiz · Sep 2025
  5. [5]The nx s1ngularity attack: inside the credential leak · GitGuardian · Sep 2025
  6. [6]Weaponizing AI coding agents for malware in the nx malicious package · Snyk · Aug 2025
  7. [7]Self-propagating supply chain attack hits 187 npm packages · BleepingComputer · Sep 2025
  8. [8]Shai-Hulud npm supply chain attack · Wiz · Sep 2025
  9. [9]Shai-Hulud 2.0 npm worm · Datadog Security Labs · Nov 2025
  10. [10]Shai-Hulud 2.0: inside the second coming · Check Point Research · Nov 2025
  11. [11]New SANDWORM_MODE supply chain attack hits npm · SecurityWeek · Feb 2026
  12. [12]Shai-Hulud-like worm targets developers via npm and AI tools · Infosecurity Magazine · Feb 2026
  13. [13]AI vulnerability exploitation, augmented operations and initial access · Google Threat Intelligence Group · 11 May 2026
  14. [14]The LiteLLM supply chain attack: TeamPCP SANDCLOCK campaign via a backdoored Trivy GitHub Action · Resecurity · Mar 2026
  15. [15]LiteLLM breach: 2,500 companies, 434,000 CI/CD pipelines · Hackread · Mar 2026
  16. [16]Shai-Hulud: The Third Coming, inside the Bitwarden CLI 2026.4.0 supply chain attack · Endor Labs · Apr 2026
  17. [17]Bitwarden CLI compromised in ongoing supply chain attack · The Hacker News · Apr 2026
  18. [18]Mini Shai-Hulud: TeamPCP and TanStack · Phoenix Security · May 2026
  19. [19]Shai-Hulud open-source framework: static analysis · Datadog Security Labs · May 2026
  20. [20]Hades PyPI supply chain attack · Orca Security · Jun 2026
  21. [21]npm 12 disables install scripts by default · The Hacker News · Jul 2026
  22. [22]Massive ChainDrop npm supply chain attack infects hundreds of packages · BleepingComputer · Aug 2026
  23. [23]npm worm compromises popular npm packages · Datadog Security Labs · Aug 2026
  24. [24]Malicious file in Downloads folder hijacks AI coding agents · The Hacker News · Oct 2026
  25. [25]AI coding agents hijacked using AGENTS.md file in Downloads folder · BleepingComputer · Oct 2026
  26. [26]Agentic threat activity crosses a significant threshold · Google Threat Intelligence Group · 16 Nov 2026
  27. [27]First malicious MCP server found in the wild · The Hacker News · Sep 2025
  28. [28]Postmark MCP server code hijacked · The Register · 29 Sep 2025
  29. [29]Critical mcp-remote vulnerability · The Hacker News · Jul 2025
  30. [30]CVE-2025-6514 · Wiz Vulnerability Database · Jul 2025
  31. [31]CVE-2025-49596 · Wiz Vulnerability Database · Jun 2025
  32. [32]The MCP Registry by the numbers · dev.to census · 2026
  33. [33]MCP server census, August 2026 · Skillselion · Aug 2026
  34. [34]MCP servers: the new security nightmare · Equixly · 29 Mar 2025
  35. [35]MCP server security risks research · Backslash Security · 2025
  36. [36]Mapping MCP servers study · Knostic · 2025
  37. [37]The State of Secrets Sprawl 2026 · GitGuardian · Mar 2026
  38. [38]FAQ: CVE-2025-54135 and CVE-2025-54136 in Cursor (CurXecute, MCPoison) · Tenable · Aug 2025
  39. [39]Cursor AI code editor vulnerability · The Hacker News · Aug 2025
  40. [40]Critical Cursor flaws could let prompt injection escape the sandbox · The Hacker News · Jul 2026
  41. [41]Sandbox bypass flaws in Cursor IDE highlight prompt injection as an RCE vector · CSO Online · 2026
  42. [42]GitHub Copilot remote code execution via prompt injection · Embrace The Red · Aug 2025
  43. [43]Code execution through deception: Gemini AI CLI hijack · Tracebit · Jul 2025
  44. [44]Google Gemini CLI prompt injection and arbitrary code execution · CyberScoop · Jul 2025
  45. [45]GHSA-wpqr-6v78-jr5g (CVE-2026-12537) · GitHub Advisory Database · 24 Apr 2026
  46. [46]My agentic trust issues: from prompt injection to supply chain compromise on Gemini CLI · Pillar Security · Apr 2026
  47. [47]GHSA-4fgq-fpq9-mr3g (CVE-2025-59536) · GitHub Advisory Database · 3 Oct 2025
  48. [48]GHSA-ff64-7w26-62rf (CVE-2026-25725) · GitHub Advisory Database · 6 Feb 2026
  49. [49]Claude Code flaws allow remote code execution · The Hacker News · Feb 2026
  50. [50]Detecting and countering misuse of AI: August 2025 · Anthropic · 27 Aug 2025
  51. [51]Advances in threat actor usage of AI tools · Google Threat Intelligence Group · 5 Nov 2025
  52. [52]Disrupting the first reported AI-orchestrated cyber espionage campaign · Anthropic · 13 Nov 2025
  53. [53]Full report (PDF) · Anthropic · Nov 2025
  54. [54]Chinese spies used Claude to attack · The Register · 13 Nov 2025
  55. [55]Disrupting malicious uses of AI: October 2025 · OpenAI · 7 Oct 2025
  56. [56]OpenAI report on malicious ChatGPT use · Help Net Security · 26 Feb 2026
  57. [57]Distillation, experimentation and (continued) integration · Google Threat Intelligence Group · 12 Feb 2026
  58. [58]ARTEX and friends enter agentic offensive frameworks · Google Threat Intelligence Group · 30 Oct 2026
  59. [59]Detecting and countering misuse of AI: September 2026 · Anthropic · 10 Sep 2026
  60. [60]Hackers abused Claude to extract secrets from 1.8 million Android apps · BleepingComputer · Sep 2026
  61. [61]AI-enabled cyber threats mapped to MITRE ATT&CK · Anthropic · 3 Jun 2026
  62. [62]OWASP Top 10 for Agentic Applications for 2026 · OWASP GenAI Security Project · 9 Dec 2025
  63. [63]OWASP agentic top 10 explained · Speakeasy · 2026
  64. [64]Careful adoption of agentic AI services · CISA, NSA and partners · 30 Apr 2026
  65. [65]CISA releases guidance on the careful adoption of agentic AI services · Inside Privacy (Covington) · May 2026

Keep reading

Get started

Ship the AI.
Keep the control.

The harness is up in under two minutes. Free to start, no card needed.

Harness listening · deploy in under 2 minutes

Start free Developer plan · 50K tokens/mo · 3 seats

Book a demo

We’ll walk it through with your stack in mind.

anupama@konsole.one, sheoli@konsole.one

A product of ClearTrust · Secure · Private · Model-agnostic