Pular para o conteúdo

// Security by tool

Security of GitHub Copilot-generated code

7 minUpdated July 25, 2026By Ler em português

Quick answer

Copilot security has two axes. The first is Copilot itself: CVE-2025-59145 (CamoLeak, CVSS 9.6) was a zero-click prompt injection, a hidden instruction in a pull request description made Copilot Chat exfiltrate code and secrets from a private repo, encoding the data into GitHub’s Camo image-proxy URLs. CVE-2025-53773 showed code execution on the machine via prompt injection. Both were fixed, but they prove the agent executes untrusted context as an order.

The second axis is the code it generates: AI assistants repeat the insecure pattern they saw in training (concatenated query, a check in the front-end, a hardcoded secret). Copilot accelerates, but does not guarantee that what it wrote protects login, billing or customer data. Both axes need review.

Where the risk shows up

One part is Copilot configuration (what it can read and execute); the other is the code in your repository. Handling only one side leaves the other open.

Two axes of risk with Copilot
AxisReal exampleDefense
Prompt injection in the agentCamoLeak (CVE-2025-59145) exfiltrates a private repoDo not let external context become a command
RCE via injectionCVE-2025-53773 runs code on the machineKeep updated, limit auto-execution
Insecure code suggestedConcatenated query, auth in the front-endHuman review of what was generated
Secret in a suggestionHardcoded key accepted without reviewHunt for secrets before commit

How RET reviews Copilot code

RET looks at what matters: the flows Copilot wrote that touch access, money and data. It tests whether authorization lives on the server, whether no secret was accepted via suggestion, and whether input becomes a query safely. And it advises on Copilot configuration (what the agent can read and execute) because of the injection CVEs.

The Promptbook has prompts for you to review what the AI generated, forcing it to flag where it had too much permission or repeated an insecure pattern. When the flow is critical, Risk Review does the human read.

  • Human review of generated code in the sensitive flows.
  • Agent config: external context does not become a command, execution limited.
  • Hunt for secrets accepted via suggestion before commit.

You may already be exposed if

Signals that call for a review of a project using Copilot.

  • You accept code suggestions in auth/billing flows without reviewing the security.
  • Copilot Chat reads issues/PRs from external sources and you do not limit what it executes.
  • A key or password already appeared in a suggestion that got committed.
  • A B2B customer asked for proof that the code (even AI-generated) was reviewed.

Want to know whether this happens in your system?

Manual pentest for web applications, APIs and apps, from R$9,500, with the Sprint run within 7 business days. We refund 50% if we find no flaw.

See price and timeline for my case

Frequently asked questions

Does CamoLeak still affect me?

CVE-2025-59145 was fixed by GitHub (disabling image rendering in Copilot Chat in August 2025). The lesson remains: an agent that reads external context (a PR description, an issue) can be hijacked by a hidden instruction. Limit what it executes and do not treat external content as an order.

Is Copilot code insecure?

Not by definition, but it repeats the pattern it saw in training, including the insecure one (concatenated query, auth in the front-end, hardcoded secret). The acceleration is real; the security guarantee does not come with it. So what it generates in a sensitive flow needs review.

How do I review AI-generated code without being an expert?

The Promptbook gives you prompts to force the AI itself to walk the flows and flag risk. It is the cheap first pass; when access is critical, Risk Review does the human read.

Who runs the review at RET?

Gabriel Lima Ferreira, founder and lead pentester, with an authorized scope and reproducible evidence.

Keep reading