← All Articles 🤖 AI Comparison & Trending Critical By Nishant Kumar Verma Updated

Prompt Injection Is Now OWASP's #1 AI Threat: When Your Coding Agent Becomes the Attacker

Prompt injection tops the OWASP 2026 list and the Bitwarden CLI worm hunted Claude, Cursor and Codex credentials. Why the code your agent commits is now your attack surface. Sources: Help Net Security, Microsoft, Palo Alto, Endor Labs.

SEC-014 SEC-015 QUA-014

Quick Answer

Prompt injection is the number one risk in OWASP's Top 10 for LLM Applications (LLM01, the same spot it held in the 2023 list), and according to Help Net Security's June 2026 report OWASP maps it to six of the ten categories in its Top 10 for Agentic Applications. The threat has moved from "the chatbot says something rude" to "the coding agent in your editor runs attacker-controlled commands." In April 2026 a trojanized Bitwarden CLI package was caught probing developer machines for AI coding tools such as Claude Code, Codex CLI, and Aider. This article explains what changed, why your agent is now part of the attack surface, and the one part of the problem you fully control: the code that gets committed. Every claim is attributed to a named source.

Why Prompt Injection Tops the List

The structural reason is simple and, for now, unsolved. As Help Net Security summarizes the OWASP position, large language models "treat the system prompt, the user's request, and any text retrieved from external sources as a single stream of tokens." The model cannot reliably tell your instructions apart from instructions hidden in a file it just read. When that model can also run shell commands, edit files, and open network connections, a malicious instruction in a README or a pull request becomes executable.

This is why Securance and other trackers put prompt injection at the top of the 2026 threat list. It is not the most sophisticated attack. It is the one with the widest reach, because every retrieval-augmented agent, every "read this repo and fix it" workflow, and every MCP tool integration is a potential injection point.

The Shift: Your Agent Is Now the Attack Surface

A run of CVEs in 2025 and 2026 made the abstract concrete. These are real, assigned identifiers, not hypotheticals. The descriptions follow the NVD entries, and the severities are the vendor (CNA) scores listed there.

CVE Tool What the injection does Severity
CVE-2025-53773 GitHub Copilot and Visual Studio Command injection lets an attacker run code on the developer's machine; per Wiz, injected instructions get Copilot to turn on auto-approve in .vscode/settings.json CVSS 7.8
CVE-2026-22708 Cursor Prompt injection poisons shell environment variables so allowlisted commands behave differently High
CVE-2025-54135 (CurXecute) Cursor Indirect prompt injection creates a new .cursor/mcp.json without approval and triggers RCE High
CVE-2025-6514 mcp-remote (MCP client proxy) A malicious MCP server's authorization URL leads to OS command injection on the client CVSS 9.6
CVE-2025-59532 OpenAI Codex CLI A model-generated working directory moves the sandbox's writable root outside the project High

Microsoft's own research, "When prompts become shells," documents the same theme across agent frameworks: the gap between "the model decided to run this" and "an attacker decided to run this" can be a single line of hidden text. Help Net Security, citing OWASP's tracking of 53 agentic projects, notes that the five fastest-growing tools (Claude Code, Gemini CLI, Codex, Cline, and Aider) are all coding agents, and that Claude Code has the second-most security advisories of the projects tracked, at 22.

The Bitwarden CLI Worm That Hunted AI Credentials

The most direct warning shot landed on 22 April 2026. According to Palo Alto Networks and Endor Labs, a malicious version of the @bitwarden/cli npm package was live for roughly 90 minutes. The payload stole GitHub and npm tokens, SSH keys, .env files, and cloud secrets, then self-propagated by backdooring any package the victim could publish.

The detail that matters for this audience: according to Endor Labs, the malware checked for Claude Code, Gemini CLI, Codex CLI, Kiro, Aider, and OpenCode, and if one of them was logged in, it added a shell hook to ~/.bashrc and ~/.zshrc. Researchers quoted by OpenSourceForU called it the first analysed npm compromise explicitly targeting AI coding tools (see also The Hacker News). The attackers understand that a developer's machine running an agent is a high-value target: it holds cloud keys, repo write access, and now an autonomous tool that can be steered.

A Mental Model: The Lethal Trifecta

You cannot patch the token-stream problem yourself, so the practical defenses are about limiting what an injected instruction can reach. Help Net Security highlights two heuristics that have become standard.

The first is the "Lethal Trifecta": danger spikes when an agent simultaneously has access to private data, exposure to untrusted content, and the ability to communicate externally. Remove any one leg and exfiltration gets much harder. The second is Meta's "Agents Rule of Two": an agent operating without human approval should satisfy at most two of those three properties at once. If your agent reads arbitrary repos (untrusted content) and holds your cloud keys (private data), then it should not also be able to make arbitrary outbound network calls unattended.

// ❌ BAD - all three legs of the trifecta, unattended.
// Agent has: repo write + cloud keys in env + unrestricted shell/network,
// and auto-runs on every "review this external PR" with no human gate.

What You Actually Control: The Code That Ships

You cannot stop a model from reading a poisoned README. You can control what an attacker finds if a payload runs in your environment, and what your agent quietly commits. Both are scannable.

// ✅ GOOD - nothing worth stealing sits in the tree.
// config.ts
export const OPENAI_KEY = process.env.OPENAI_KEY;          // read at runtime
export const SUPABASE_SERVICE_ROLE = process.env.SUPABASE_SERVICE_ROLE;
// .env is gitignored, secrets live in a manager and rotate on a schedule,
// and every new dependency the agent adds is verified before install.
  1. Keep secrets out of the repo and out of git history. A credential-harvesting payload greps the working tree first. If there is nothing there, the trifecta's "private data" leg shrinks.
  2. Review what the agent commits, not just what it says. An injected instruction can add a dependency or a network call you never asked for. Diff the agent's commits, especially lockfile and config changes.
  3. Verify new imports. Injection and slopsquatting both end in a bad package name landing in your package.json. Confirm each one exists and is the package you intended.
  4. Scan the output automatically. VibeDoctor's Vibe Check automatically scans your codebase for hardcoded secrets, private keys, and hallucinated or freshly-published imports, and flags the exact file and line, so the residue an agent or a payload leaves behind does not reach production. Free to sign up.
  5. Gate autonomous runs on untrusted content. Require human approval before an agent acts on an external PR, issue, or web page.

FAQ

Can prompt injection be fully prevented?

Not today. Because the model processes instructions and data as one token stream, there is no reliable parser-level separation. The defenses that work are about reducing blast radius: limiting an agent's permissions, gating risky actions on human approval, and keeping high-value secrets out of reach. OWASP's LLM01 entry says it is unclear whether fool-proof prevention exists and lists measures that reduce the impact instead, so treat it as a risk to be contained, not a bug to be patched once.

Does this mean I should stop using Claude Code, Cursor, or Codex?

No. Advisory counts reflect scrutiny and popularity as much as risk, and all of these tools ship fixes quickly. The point is to use them with the same caution you would give any process that can run shell commands: keep them updated, do not auto-approve actions on untrusted input, and scan what they produce.

What was actually stolen in the Bitwarden CLI attack?

According to Palo Alto Networks and Endor Labs, the payload harvested GitHub and npm tokens, SSH keys, .env contents, and cloud secrets from infected developer machines, and probed for logged-in AI coding tools. Bitwarden stated it found no evidence that end-user vault data was accessed. The risk was to developers who installed the bad version, whose local secrets and publish tokens were the target.

What is the "Lethal Trifecta" in one sentence?

An AI agent is dangerous when it can simultaneously access private data, read untrusted content, and communicate externally. Break any one of those three and a successful injection has far less it can do.

How does scanning my own code help against an injection in someone else's repo?

It addresses the two outcomes you can measure. First, it shrinks the prize: if no secrets sit in your tree, a payload that runs has less to steal. Second, it catches the residue: injected instructions often end with a new dependency, a hardcoded endpoint, or a secret written into a file. Scanning your repo on every change surfaces those changes regardless of where the injection came from.

Diagnose your codebase - free

VibeDoctor checks for SEC-014, SEC-015, QUA-014 and 148 other issues across 21 diagnostic areas - security, performance, code quality, and more.

SCAN MY APP →