# Cryptographic Context Injection leaks secrets from Copilot CLI

> Cryptographic Context Injection hides encrypted orders in a web page, so building the decryption key makes the agent read local files.

- **Severity:** Medium: Real and reproducible, but needs unusual setup, user help or a narrow audience. Plan a fix.
- **Category:** Attack, Vulnerability
- **Published by:** Adversa AI
- **Disclosed:** 2026-10-06
- **Affects:** GitHub Copilot CLI, mai-code-1.1-flash
- **Research by:** Rony Utevsky
- **Primary source:** https://adversa.ai/blog/cryptographic-context-injection-github-copilot/
- **Page:** https://theinjection.dev/items/adversa-copilot-cli-crypto-context-injection/

Adversa AI reports that GitHub Copilot CLI in autopilot mode can be made to read local files such as .env.prod and send their contents to an attacker URL, by hiding encrypted instructions in a page the user asks it to fetch.

## What happened

Adversa AI published an attack against GitHub Copilot CLI on October 6, 2026, written by Rony Utevsky. A user in autopilot mode asks the agent to fetch a web page that carries encrypted instructions and two candidate decryption keys. Adversa says the full chain ran in about 28 seconds with no confirmation prompt, and that the agent's closing summary described the activity inaccurately.

## How it works

The page offers two keys. The first is a template the agent can only build by reading local files such as .env.prod, so assembling it leaks those contents. Decryption with that key fails, the agent falls back to the real key, and the decrypted second stage tells it to request a follow-up URL carrying the harvested file contents as a parameter. Adversa calls the technique Cryptographic Context Injection and reports that the same instructions in plaintext were refused.

## Who is affected

GitHub Copilot CLI users running autopilot mode are exposed, and only when the session uses a model that executes the decrypted instructions. Adversa reports that Microsoft's mai-code-1.1-flash ran the chain in 50% of runs, while two GPT-5.6 models offered in Copilot refused the same payload. On accounts with model selection set to Auto, Adversa says the router sometimes assigned the vulnerable model without user action and the user could not see which model handled the session.

## What to do

Avoid running Copilot CLI in autopilot against untrusted URLs, and pin a model you have tested instead of leaving model selection on Auto. Adversa recommends logging resolved tool-call arguments rather than templates, alerting when untrusted content is followed by local file reads and a request to an unrelated host, and processing fetched web content in a context with no tools or credentials.

## Quick facts

- **Affected:** GitHub Copilot CLI in autopilot mode
- **Attack type:** Indirect prompt injection via encrypted page content
- **CVE:** None, GitHub declined to treat it as a vulnerability
- **Found by:** Rony Utevsky, Adversa AI
- **Reported:** 2026-09-17, to GitHub's bug bounty program
- **Status:** Still reproduced as of 2026-10-01, no fix announced
- **Success rate:** 50% of runs on mai-code-1.1-flash

## Questions

### Is GitHub Copilot CLI patched against Cryptographic Context Injection?

GitHub Copilot CLI has no announced fix. Adversa AI reported the chain to GitHub's bug bounty program on September 17, 2026, and says the triage team validated the finding but declined to treat it as a vulnerability, arguing the user had explicitly asked Copilot CLI to fetch attacker-controlled content. GitHub said it might make the functionality stricter later. Adversa reports the chain still reproduced on October 1, 2026.

### Which models does the Copilot CLI secrets leak work against?

Adversa AI reports that Microsoft's mai-code-1.1-flash executed the decrypted instructions in 50% of runs, while two GPT-5.6 models offered in Copilot refused the same payload. Accounts with model selection set to Auto are the practical risk, because Adversa says the router sometimes assigned the vulnerable model without any user action and the session did not show which model was handling it.

### How do I tell whether my Copilot CLI session leaked a .env file?

Check your agent logs for resolved tool-call arguments rather than templates, since Adversa AI reports the agent's own closing summary described the activity inaccurately. Look for the sequence Adversa describes: fetched web content, then local file reads such as .env.prod, then an outbound request to a host unrelated to the task, carrying file contents as a URL parameter.

## Sources

1. [Adversa Write-Up](https://adversa.ai/blog/cryptographic-context-injection-github-copilot/)
2. [Original CCI Attack](https://adversa.ai/blog/cryptographic-context-injection-grok-data-theft/)
