GitHub Copilot reproduces verbatim licensed code and embedded secrets
Date: 2023-01
Affected: GitHub Copilot users — risk of introducing unlicensed code or live credentials into projects
Attack vector: other
Category: research-demonstrated
Severity: High

Multiple studies showed that GitHub Copilot — trained on public GitHub repositories — would reproduce verbatim code from its training data, including open-source code with restrictive licenses (GPL, etc.) and, more critically, code containing hardcoded API keys, passwords, and private keys that were committed to public repositories. Researchers at NYU demonstrated that Copilot suggestions included identifiable code from training data ~1% of the time for common patterns, and that secrets appeared in a measurable fraction of generated code. This led to the Doe v. GitHub class action lawsuit.

Impact: License compliance violations; potential exposure of live API keys from training data; class action lawsuit filed

Mitigations:
Training data deduplication and memorisation testing before deployment
Secrets scanning on model output before delivering code suggestions
Training data governance — scan corpus for secrets before ingestion (DSGAI07)
Output filtering for patterns matching known API key formats

Architectural layers (MAESTRO):
label: Foundation Models
notes: Model memorised and reproduced training data including secrets — insufficient data governance during training
role: origin
label: Data Operations
notes: Training corpus included repositories with embedded credentials; no secrets scanning before training ingestion
role: origin
label: Evaluation & Observability
notes: No memorisation detection or output scanning for secrets in generated suggestions
role: blind-spot