GitHub Copilot CLI and Cryptographic Context Injection: How Encrypted Text on a Web Page Leaks Your Secrets

By Carlos Montiel | Enterprise AI Specialist
Leer en español →
Published: 2026-10-08 | By: Carlos Montiel | Reading time: ~5 minutes

Adversa AI disclosed on October 6, 2026 that GitHub Copilot CLI can be induced, using encrypted instructions hidden in a web page, to read local files such as .env.prod and send them to an attacker’s server. GitHub validated the behavior but classified it as "not a product vulnerability."

The Technique: Cryptographic Context Injection (CCI)

CCI hides malicious instructions inside an encrypted block (AES-256-GCM) embedded in an otherwise normal web page. Content classifiers that scan plain text see nothing suspicious. The agent, however, decrypts the block inside its own execution environment and treats the result as trusted output rather than untrusted external content. Adversa had already demonstrated the same idea against Grok; this time it applied it to a terminal coding agent.

The Attack Chain, Step by Step

1. The developer asks Copilot CLI to open an attacker's page 2. The page carries ciphertext and two decryption "keys" 3. One key is legitimate; the other is templated to request local data 4. The agent reads the target files and inserts them into a string 5. Decryption fails on purpose → the agent tries the genuine key 6. The decrypted text instructs the agent to open another URL 7. That URL carries the secrets as parameters → exfiltration

In the demonstration reported by CyberPress, the CLI transmitted the contents of a .env.prod file to an attacker endpoint in 28 seconds, and it could also reach files outside the working directory.

The Model "Lottery" and Autopilot Mode

The attack requires the CLI to run in autopilot mode (automatic approvals) and to read a compromised page. According to The Register, success depends on which model handles the request: Microsoft’s mai-code-1.1-flash model ran the full chain in 50% of attempts, while OpenAI’s GPT-5.6 models refused the payload. With "Auto" model selection, users don’t know which model is serving their session, so their exposure is unpredictable.

GitHub’s Response and the Debate

Adversa reported the case to GitHub’s bounty program on September 17. GitHub validated the behavior but responded that it "requires a user to intentionally direct Copilot CLI to fetch untrusted or attacker-controlled content and confirm they want to trigger the action, and is therefore not a product vulnerability." No CVE was assigned and, according to CyberPress, the chain was still reproducible on October 1. Adversa disagrees.

Two valid readings: for GitHub, the user granted autonomous permissions and asked it to read that site; for Adversa, the agent turns untrusted content into trusted instructions by decrypting it. For your company, the argument over who is "to blame" matters less than the fact itself: with no patch and no CVE, the mitigation is on you.

Mitigations That Are Up to You

For companies adopting coding agents: the risk is not in the model but in the combination of three things: untrusted content, access to sensitive files, and the ability to reach the network. Remove any one of the three and the chain breaks. Define that policy before you enable autonomy, not after an incident.
Carlos Montiel
Enterprise AI Solutions Architect
Specialist in LLMs, Agents, and Orchestration
guatemalia.com/#contacto · info@guatemalia.com

Need to implement AI in your company?

Carlos Montiel is an enterprise AI solutions architect. He implements LLMs, Agents, RAG, and orchestrators for companies across Guatemala and Latin America. Reach out for a consultation.

Contact Carlos Montiel

info@guatemalia.com