Kiro Let Web Prompt Injection Rewrite Its MCP Config and Execute Code

Researchers from Intezer and Kodem Security found that hidden instructions in a webpage could make AWS’s Kiro agentic IDE rewrite the user-level file that defines its Model Context Protocol servers. Kiro then reloaded the configuration and launched the attacker-specified server command with the developer’s privileges. The user approved a web fetch—not a configuration change or code execution.

The joint research, published July 19, says the chain worked against Kiro IDE 0.9.2 on macOS and 0.10.16 on Ubuntu in the default Autopilot workflow. The researchers reported it through HackerOne on February 11. They say AWS patched the issue and declined to assign a CVE; independent follow-up confirmed the proof of concept failed on Kiro 0.11.130. Current users should move to the latest available release rather than treating that build as a long-term target.

The finding matters because the model did not need direct permission to run a shell command. It edited ~/.kiro/settings/mcp.json, a file whose contents become commands when Kiro discovers and starts configured MCP servers. A data-writing capability therefore became an execution capability through an automatic reload path.

A benign fetch crossed four trust boundaries

The proof of concept served ordinary-looking API documentation with instructions hidden in one-pixel white text. A developer asked Kiro to fetch the page. Kiro correctly requested approval for the unfamiliar URL, but after the developer allowed that fetch, the model also processed the concealed text as setup instructions.

Those instructions directed the agent to create a user-level MCP entry with node as its command and an inline script as an argument. Kiro’s file-writing tool could modify the configuration without a separate approval, and a configuration reload started the new server. The demonstration payload reported the machine’s hostname, username, and platform to a local callback; the primitive could execute other code available to the logged-in developer.

This sequence joins four operations that look separate in a tool catalogue: retrieving untrusted content, writing a file, reconfiguring available tools, and launching a process. The security outcome is determined by their composition. Approval on the first step cannot authorize the downstream steps when the prompt neither displays nor binds those effects.

The researchers observed that Kiro sometimes displayed a notification that MCP configuration had changed. It was not an effective gate: according to their testing, the reload proceeded regardless of the user’s response. A warning after a consequential write is visibility, not authorization.

The agent could edit the mechanism that expands its authority

mcp.json is not ordinary workspace content. It names external tool servers and the exact local commands used to start them. Permitting an agent to update it silently is equivalent to permitting the agent to install and launch executable extensions, even if the file operation itself appears low risk.

The placement under the user’s home directory also crosses project boundaries. A malicious page encountered while working in one repository could modify a global configuration used by later projects. This turns a transient prompt-injection event into a persistent change in the developer’s agent environment.

Model behavior made exploitation probabilistic—the researchers report success within one or two attempts, while some runs only summarized the page. That uncertainty does not create a dependable defense. Authorization controls must assume the model can be fully persuaded and still prevent unapproved changes to execution-sensitive state.

The pattern resembles FakeGit’s abuse of agent capability discovery: both attacks turn an apparently helpful extension path into software delivery. In one case the lure is a repository or skill surfaced during discovery; in the Kiro chain it is content that causes the agent to register a new MCP process directly.

This was a recurrence, not a new threat class

Johann Rehberger disclosed a closely related Kiro chain in July 2025: indirect prompt injection could write malicious MCP configuration or alter VS Code settings that controlled shell-command approval. AWS’s October 2025 bulletin says Kiro 0.1.42 added human-in-the-loop confirmation for those actions when configured in Supervised mode. The newer research shows why a mode-dependent prompt did not settle the architectural issue for default Autopilot operation.

A separate Kiro path involving automatic execution through .vscode/tasks.json was tracked as CVE-2026-10591. Although the trigger differs, the shared defect shape is an agent writing execution-sensitive configuration without an enforcement point outside the model.

The current remediation moves the boundary into the platform. Kiro now treats MCP configuration, VS Code task configuration, .git, and other sensitive locations as protected paths requiring explicit approval. Intezer’s retest found the attack unsuccessful on 0.11.130 in both Autopilot and Supervised modes. That is the right control location: the file operation is blocked based on the destination’s security meaning, not on whether the model recognizes an instruction as malicious.

Defensive engineering guidance

  • Update Kiro beyond the confirmed repair. Install the latest IDE release, restart the application, and verify the running build. Retire unmanaged or offline installations in the 0.9 and 0.10 lines.
  • Inspect user-level MCP configuration. Review ~/.kiro/settings/mcp.json for unknown servers, shell interpreters, inline scripts, remote package runners, unfamiliar working directories, and unexpected environment variables.
  • Check adjacent execution files. Audit workspace and user settings, .vscode/tasks.json, hooks, agent rules, and other files that can authorize commands or trigger processes. An empty MCP file does not rule out a neighboring persistence path.
  • Require destination-aware approval. File-write policy should classify paths by consequence. Changes to MCP registries, editor tasks, hooks, CI workflows, package-manager configuration, and shell startup files should always show a diff and require a fresh decision.
  • Bind consent to the complete effect. “Allow this URL?” is not permission to install a tool. Approval interfaces should name the file, configuration diff, process command, network destination, and persistence scope before activation.
  • Separate configuration from activation. Do not automatically execute newly written extension or MCP configuration. Validate it, show it to the user, and require an independent activation event outside the agent’s tool sequence.
  • Constrain child processes. Run coding agents with minimal filesystem and credential access, restrict egress, and monitor process trees for interpreters or package runners spawned immediately after an agent configuration change.
  • Log composed action chains. Alert when external content ingestion is followed by writes to protected paths, MCP reloads, or new child processes. Individual tool calls can look normal while the sequence is clearly anomalous.

Kiro’s patch addresses the disclosed path, but the durable lesson applies to every extensible coding agent. Files that define tools, permissions, hooks, or executable tasks are part of the trusted computing base. If the model can silently rewrite them, the agent can convert prompt injection into new authority without ever requesting the dangerous action by name.

Sources: