# GitHub Copilot prompt injection → autoApprove RCE (CVE-2025-53773)

- ID: copilot-autoapprove-cve-2025-53773
- Reported: 2025-08-12
- Researcher: Johann Rehberger
- Organization: Embrace The Red
- AI role: ai_agent_or_mcp_as_target (Agent / MCP as target)
- Confidence in AI involvement: not assessed
- Research / borderline: false
- Last reviewed: 2026-10-20
- Entry page: https://openattacks.ai/attacks/copilot-autoapprove-cve-2025-53773/
- Entry JSON: https://openattacks.ai/api/attacks/copilot-autoapprove-cve-2025-53773.json
- Browse title: GitHub Copilot prompt injection enables auto-approve RCE (CVE-2025-53773)
- Editorial summary: Prompt injection could make Copilot turn on auto-approve in its settings and then run shell commands without confirmation on Windows, macOS and Linux. Patched in VS 2022 17.14.12.
- Evidence class (catalog annotation): Vulnerability report
- Source-stated target environments: Agents & MCP; Windows; macOS; Linux
- Stage hunts and conditional defenses: https://openattacks.ai/api/defenses/copilot-autoapprove-cve-2025-53773.json

## Technique
Prompt injection could make Copilot write chat.tools.autoApprove true into .vscode/settings.json (YOLO mode), enabling shell commands without confirmation. Delivery via malicious source, web content, GitHub issues, or MCP responses. Affects Win/macOS/Linux. Patched VS 2022 17.14.12.

## Stack relevance (editorial)
Assessment: mapped. Editorial applicability reviewed against the catalog source account; not a scan or independent incident verification.
First action: Check the vendor advisory and audit agent auto-approval settings and repository instructions.
- Relationship: target; tools: github-copilot; OS scope: windows, macos, linux; requires existing MCP connections: false.
  Relevance: The report describes prompt injection changing Copilot approval settings before shell execution.
  Condition to check: Confirm that the installed version is affected by the historical report; selecting a product does not establish its version or patch status.
  Condition to check: Untrusted project content must reach the agent and the affected settings / command-execution workflow.
  Evidence: https://embracethered.com/blog/posts/2025/github-copilot-remote-code-execution-via-prompt-injection/ ; https://msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2025-53773
A product mention alone is not a victim-side applicability mapping. Selection does not verify affected versions, permissions or compromise.

## Initial access
Indirect prompt injection into Copilot context

## AI tooling and models
- [GitHub Copilot](https://github.com/features/copilot)
- Visual Studio

## Other tooling
- unknown

## Victims and sectors
unknown

## Target geography
- unknown

## Attribution
unknown

## Scale and metrics
CVE-2025-53773; patched Aug 2025

## Attack flow
Catalog reconstruction of the supplied source account. Unknowns and research caveats are preserved.
### step-1: Untrusted content enters context [access]
Malicious source, web content, issues or MCP responses reach Copilot.
Evidence: https://embracethered.com/blog/posts/2025/github-copilot-remote-code-execution-via-prompt-injection/ ; https://msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2025-53773

### step-2: Indirect instructions redirect Copilot [ai]
Injected instructions induce an edit to the workspace settings.
Evidence: https://embracethered.com/blog/posts/2025/github-copilot-remote-code-execution-via-prompt-injection/ ; https://msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2025-53773

### step-3: Automatic tool approval is enabled [execution]
The agent writes chat.tools.autoApprove into .vscode/settings.json.
Evidence: https://embracethered.com/blog/posts/2025/github-copilot-remote-code-execution-via-prompt-injection/ ; https://msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2025-53773

### step-4: Shell actions bypass confirmation [impact]
The changed setting permits command execution without the expected approval.
Evidence: https://embracethered.com/blog/posts/2025/github-copilot-remote-code-execution-via-prompt-injection/ ; https://msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2025-53773

Connections:
- step-1 -> step-2
- step-2 -> step-3
- step-3 -> step-4

## Stage defense and hunting recommendations
Editorial recommendations, not validated coverage. Source-controlled query starters are drafts. Custom-schema examples require telemetry collection and field mapping; absence of a mapping means not assessed. MagicSword policy opportunities require managed Windows scope and enforcement.
### step-1: Untrusted content enters an agent session
- Visibility: Application / agent audit records
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/agent-input.sigma.yml
- KQL query download: /api/detections/agent-input.kql
- SPL query download: /api/detections/agent-input.spl
- Hunt hypothesis: An agent ingests external content or an untrusted session identifier before a tool action or configuration change outside the approved task.
- Required telemetry: Input provenance, source type and request/session identifier; Captured tool responses or retrieved content where collection is approved; Subsequent tool calls, configuration changes and approval decisions
- Investigate: Join the ingested input to later actions by session or request ID; preserve the original content as evidence.
- Investigate: Compare the resulting action with the approved task and baseline. Receiving suspicious text alone is not successful injection.
- Limitation: Requires application instrumentation and a custom field mapping. Input exposure does not prove that the model followed instructions, executed a tool or bypassed approval. Avoid collecting sensitive prompt bodies unless authorized.
- Qualification: Preserve the source and session for ingested repository, web, issue or MCP content; exposure alone is not execution.
- No direct MagicSword prevention claim is recorded for this stage.

### step-2: Unexpected agent tool use
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/agent-tools.sigma.yml
- KQL query download: /api/detections/agent-tools.kql
- SPL query download: /api/detections/agent-tools.spl
- Hunt hypothesis: Untrusted content or a changed tool definition precedes a file read, command, or remote call outside the user's intended task.
- Required telemetry: Agent tool-call audit records with session / tool / destination; Tool-definition and approval changes; Endpoint process, file-access and network evidence where available
- Investigate: Join input provenance, tool descriptions and calls by session ID and compare the action to the approved task.
- Investigate: Inspect child processes and destinations; record whether execution was in-process, local, or through a remote SaaS connector.
- Limitation: Process logs cannot recover model intent. Remote connectors and in-process interpreters may produce no local child process. Prompt content alone is not a reliable signature.
- No direct MagicSword prevention claim is recorded for this stage.

### step-3: Agent trust / configuration changes
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/mcp-config.sigma.yml
- KQL query download: /api/detections/mcp-config.kql
- SPL query download: /api/detections/mcp-config.spl
- Hunt hypothesis: A repository, dependency or agent changes MCP commands, automatic-task settings, tool approval or model-routing configuration before new execution.
- Required telemetry: File changes and before/after content for MCP / IDE configuration; Repository audit / pull-request history; Agent startup and tool-invocation logs
- Investigate: Diff command, args, environment, origin, autoApprove and task settings against the previously approved version.
- Investigate: Correlate the author and change with the next agent launch; inspect path canonicalization and trailing-dot variants where relevant.
- Limitation: A file-write event alone cannot establish what changed. Legitimate setup also changes these files; obtain a diff and authorization context.
- No direct MagicSword prevention claim is recorded for this stage.

### step-4: Unexpected agent tool use
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/agent-tools.sigma.yml
- KQL query download: /api/detections/agent-tools.kql
- SPL query download: /api/detections/agent-tools.spl
- Hunt hypothesis: Untrusted content or a changed tool definition precedes a file read, command, or remote call outside the user's intended task.
- Required telemetry: Agent tool-call audit records with session / tool / destination; Tool-definition and approval changes; Endpoint process, file-access and network evidence where available
- Investigate: Join input provenance, tool descriptions and calls by session ID and compare the action to the approved task.
- Investigate: Inspect child processes and destinations; record whether execution was in-process, local, or through a remote SaaS connector.
- Limitation: Process logs cannot recover model intent. Remote connectors and in-process interpreters may produce no local child process. Prompt content alone is not a reliable signature.
- No direct MagicSword prevention claim is recorded for this stage.


## MITRE ATLAS
Mappings are catalog annotations based on described behavior, not assignments or endorsements by MITRE.
- AML.T0051.001: Indirect — Untrusted context supplies the injected instructions.
  Technique: https://atlas.mitre.org/techniques/AML.T0051.001
  Evidence: https://embracethered.com/blog/posts/2025/github-copilot-remote-code-execution-via-prompt-injection/ ; https://msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2025-53773
- AML.T0081: Modify AI Agent Configuration — The agent changes its automatic-approval setting.
  Technique: https://atlas.mitre.org/techniques/AML.T0081
  Evidence: https://embracethered.com/blog/posts/2025/github-copilot-remote-code-execution-via-prompt-injection/ ; https://msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2025-53773

## Defensive notes
Patch VS; alert on writes enabling autoApprove; treat agent settings as execution policy

## Sources
- https://embracethered.com/blog/posts/2025/github-copilot-remote-code-execution-via-prompt-injection/
- https://msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2025-53773
