Device code phishing: an approved code reaches a Copilot CLI session
Device code phishing against GitHub Copilot CLI turns one approved code into access to an AI coding agent, not just to email.
· Microsoft · Research by Uri Oren, Dor Edry, Microsoft Security Research
Microsoft Security Research shows that device code phishing aimed at GitHub Copilot CLI, rather than at a mailbox, can let an attacker steer a running agent session, poison its memory, read synced sessions and reach private repositories.
- microsoft.comMicrosoft Research
- microsoft.comEvilTokens Analysis
- docs.github.comRemote Control Docs
- +1 sources
01What happened
Microsoft Security Research published the study on 17 November 2026, written by Uri Oren and Dor Edry. The team asked what changes when a device code lure targets an AI coding agent instead of a mailbox, and ran the case against GitHub Copilot CLI in a lab. Microsoft states it has not observed these outcomes in real campaigns.
02How it works
The OAuth device flow is the mechanism. An attacker starts a sign-in on their own client, sends the victim the code together with the real GitHub verification link under a pretext such as an IT or license check, and the user approves it. GitHub's page does not show who began the request, and an application name alone does not separate an attacker's client from an expected one. The attacker's client then completes sign-in and holds a token carrying the scopes it asked for.
03Who is affected
Any public client that supports the device flow can be abused this way, so the exposure is not limited to GitHub or to Copilot CLI. Each lab outcome depended on a setting: steering a session needed remote control enabled and allowed by policy, memory poisoning needed Copilot Memory on, and reading earlier sessions needed cloud session storage. The requested scopes, listed below, covered private repositories.
04What to do
Tell users to enter a device code only for a sign-in they started themselves, and configure Safe Links for email and Teams. Review the Copilot CLI setting that stores local sessions in the cloud and pick the least permissive option that still supports the work. During response, revoke unexpected OAuth authorizations and remove suspicious Copilot Memory entries, because Microsoft notes that turning memory off does not delete what is already stored.
Questions people ask
- Is GitHub Copilot CLI patched against device code phishing?
- GitHub Copilot CLI signs users in through the OAuth device flow, and Microsoft's researchers abused that flow rather than a software flaw, so no patch applies. Approval by the user is still required. Microsoft reports that each lab outcome depended on account settings such as remote control, Copilot Memory and cloud session storage, and that it has not seen the technique in real campaigns.
- How do I check whether someone approved an attacker's Copilot CLI sign-in?
- Review the authorized OAuth apps on the GitHub account and revoke anything unexpected, then check the account's Copilot CLI sessions, repository access and stored Copilot Memory entries for content nobody on the team added. Microsoft lists these steps for response, and says two Microsoft Defender XDR detections correlate suspicious messages and clicks with GitHub token creation and regeneration events.
- How is this different from the EvilTokens device code campaigns?
- EvilTokens, which Microsoft analyzed in September 2026, phished device codes to reach mailboxes and cloud accounts. The November 2026 research keeps the same phishing step but points it at an AI coding agent, so what an attacker gains becomes a running agent session, its memory and the repositories the account can read. Microsoft presents the agent outcomes as lab results only.
Sources 4 links, all fetched
- 1microsoft.comMicrosoft Research
- 2microsoft.comEvilTokens Analysis
- 3docs.github.comRemote Control Docs
- 4docs.github.comCopilot Memory Docs