Microsoft's Lab Simulation Finds Phished GitHub Logins Could Steer Copilot CLI Sessions and Reach Private Repos Amid a Phishing Surge
Microsoft tested a known phishing technique against GitHub Copilot CLI in a lab and found four ways a phished sign-in could be abused, as the technique surges elsewhere.
Background
The OAuth device authorization flow was built for a narrow problem: letting a device with no browser or keyboard-friendly input, such as a smart TV, printer or streaming box, sign in to an account. The client requests a short code, the user enters it on the service’s own verification page, and the client receives access once the user approves, according to BleepingComputer. The outlet reports the technique was first documented in 2020 and that malicious exploitation followed a few years later, used by both state-linked and financially motivated attackers. In a phishing version of the flow, the attacker starts the sign-in request rather than the account owner, then persuades the victim to type the resulting code into the service’s genuine login page, handing the attacker valid access and refresh tokens.
That technique has been industrializing. BleepingComputer reported in April that researchers at Push Security tracked a “15x increase in device code phishing pages detected by our research team this year” as of early March 2026, a figure that “has now risen to 37.5x,” and that the outlet counted at least 11 distinct phishing kits offering the attack, each using SaaS-themed lures, anti-bot protections and cloud-hosted infrastructure. One of those kits, EvilTokens, was described by threat-intelligence firm Sekoia as a kit that “democratizes” device-code phishing for low-skilled criminals, per the same BleepingComputer report. By May, the technique had reached established phishing-as-a-service operations beyond that list: BleepingComputer reported that “the Tycoon2FA phishing kit now supports device-code phishing attacks,” using the technique to hijack Microsoft 365 accounts and “giving them unrestricted access to the victim’s data and services, including email, calendar, and cloud file storage.”
The technique is still active against ordinary corporate accounts. Help Net Security reported on November 13 that attackers used a fake Microsoft Teams meeting-scheduler page to trick an employee at a construction company into approving a device-code sign-in, obtaining a valid session token before Huntress’s security operations center caught the intrusion. The lure impersonated a named executive at another construction firm, presented the device code as a “Booking Reference” with a countdown timer, and included a fallback that silently generated a fresh code if Microsoft’s server returned an MFA-related error, according to the outlet. None of this reporting involves AI coding tools; it establishes that the underlying technique is widespread and current.
Microsoft has fought the technique at the mailbox level before. In its own telling, the company says it “worked hard with partners in industry and law enforcement to disrupt EvilTokens in September 2026,” and that it has reported device-code phishing in campaigns including Storm-2372, which it describes as “an AI-enabled campaign in 2026,” according to Microsoft’s security blog.
Current situation
On November 17, Microsoft published new research asking a different question about the same technique: “what else can an attacker do with a phished device code authorization? What happens when the same trick targets an AI agent rather than a mailbox?” according to the Microsoft Security Blog. Microsoft researchers Uri Oren and Dor Edry used GitHub Copilot CLI as what the post calls “an illustrative example,” noting it “can work with code, run commands on a user’s machine, retain context across sessions, and allow an active session to be steered remotely,” and that “like many command-line tools, it supports the OAuth device flow for sign-in.” The post is explicit that the underlying weakness is not particular to GitHub: “The phishing technique itself is not specific to GitHub or Copilot CLI: any public client that supports the device flow can be abused the same way, and the attacker chooses the requested scopes when starting the flow.”
Microsoft ran the test in a controlled lab, not against real accounts: “A victim test account approved a GitHub device-code request initiated by an attacker client we controlled,” the post says, describing the results as “proof-of-concept results showing how existing features, working as designed, could be abused after a phished authorization,” and stating plainly that “they are not attacks we have observed in the wild.” Each of the four outcomes below also required the test victim to approve the attacker’s request and depended on which account permissions and product features were enabled.
With that single approval, Microsoft’s researchers say they could, first, “steer an active Copilot CLI session remotely, if the user has enabled remote control and organization policy allows it,” and have the agent run a command on the test machine, subject to the session’s own approval prompts and local operating-system permissions. Second, they could add misleading entries to the agent’s persistent memory using its /memory command, entries the post says “could influence later interactions” and “outlast the initial sign-in.” Third, where an organization has enabled cloud session storage, they could read the test account’s synced Copilot CLI sessions, including ones recorded before the simulation began, which the post says “may contain code snippets, file paths, architecture discussions, and other work context.” Fourth, the authorization — which Microsoft says included the repo scope along with read:user, read:org, gist and codespace — let them access private repositories available to the test account, exposure the post says “can include application code and infrastructure definitions.”
Microsoft says it built two Microsoft Defender detections for suspected Copilot CLI device-code phishing delivered by email or Microsoft Teams, and validated a disruption action that can suspend an affected GitHub Enterprise Managed User identity through an organization’s identity provider. It also mapped the simulated behavior to MITRE ATT&CK techniques T1566.002 (spearphishing link) and T1528 (stealing an application access token), while noting the mapping “describe[s] behaviors demonstrated in the proof-of-concept simulation, not an attributed campaign.”
Implications
The following is analysis drawn from comparing the sources, not a finding of any one of them. None of the sources cited here reports a device-code phishing attack that has actually targeted an AI coding agent in the wild; Microsoft’s four outcomes are a lab demonstration, and the November 13 Teams incident that Help Net Security described involved an ordinary corporate account, not a coding tool. What the sources together show is a generic weakness in an authentication flow meeting a growing and already-industrialized phishing technique, with Microsoft itself drawing the connection between the two rather than reporting that it has observed them combined.
Because Microsoft frames the underlying flaw as inherent to the OAuth device flow rather than to GitHub or Copilot specifically, the exposure it describes is not confined to one vendor’s tool: any command-line AI coding agent that offers device-code sign-in, persistent memory, synced session storage or remote session control carries a comparable shape of risk, scaled to whatever scopes and features that product enables. Microsoft’s own framing captures why the stakes differ from a phished mailbox: “As AI agents gain access to repositories, session history, and local tools, the impact of a phished authorization increasingly depends on what those agents can reach.”
The mitigations Microsoft lists are aimed at the approval step rather than the agent itself, since that is where the independent reporting also places the defense: treat any device code you did not request yourself as a phishing attempt, even on a genuine github.com or microsoft.com page, a point echoed by Huntress’s advice in the Help Net Security report to treat unexpected device-code prompts as suspicious and restrict the flow through conditional access where it isn’t needed. For organizations running Copilot CLI, Microsoft specifically recommends reviewing GitHub’s “Store local sessions in the Cloud” setting and choosing “the least permissive setting that supports your workflows,” periodically revoking unused authorized OAuth applications, limiting repository access through organization roles, and reviewing any saved Copilot Memory entries for suspicious content, since disabling memory does not delete what was already stored.
The open question both Microsoft’s post and the independent surge reporting leave unanswered is how long the gap will last between a generic phishing technique reaching industrial scale against mailboxes and the same technique being observed against an AI coding agent’s broader reach. Push Security’s tracked kits and the Teams-booking lure Huntress caught show attackers actively refining the lure and evasion side of device-code phishing now; Microsoft’s research shows what a successful lure could unlock once it lands on an account tied to a coding agent. Neither side of that gap, as reported, has yet met the other in a real incident.