Skip to content

AI

Microsoft Security says device code phishing can target AI coding agents

Microsoft Security research says device code phishing can reach GitHub Copilot CLI sessions and private repositories without a password.

https://breach-signal.com/artificial-intelligence/device-code-phishing-ai-coding-agents/

Share

Key facts

  • Microsoft Security research shows device code phishing, a method for any device-flow client, can also target AI coding agents using GitHub Copilot CLI.
  • Device code phishing is a recurring way to take over accounts: rather than stealing a password, an attacker talks someone into approving a sign-in on a genuine website by entering a code.
  • The reach of the access depends on the account and permissions and may include email, files, and cloud services.
  • GitHub Copilot CLI can, depending on setup, work with code, execute commands on a user's computer, keep context across sessions, and let an active session be guided from afar.

Microsoft Security research published Nov. 17, 2026 says device code phishing, a method for any device-flow client, can also target AI coding agents using GitHub Copilot CLI.

Device code phishing does not steal a password. An attacker begins a device-code sign-in request and convinces someone else to approve it by entering a short code on the service’s real verification page. After approval, the attacker-controlled client signs in by itself and operates within what the application and the account allow.

The OAuth device flow lets command-line tools and similar clients sign in without a full browser: the client asks for a short code, the person types it on the service’s verification page, and the client gets access after approval. In device code phishing, the attacker starts the request and sends the code and link to the user, pretending it is an IT request or a Copilot license check. The verification page is genuinely hosted by GitHub, so a real domain by itself does not show who began the request.

Microsoft Security’s controlled lab test had a victim’s test account approve a GitHub device-code request started by an attacker-controlled client. That approval let researchers reach private repositories available to the account. The request sought the repo scope together with read:user and read:org, plus gist and codespace.

The possible exposure depends on what repositories the account can reach, which might include application code and infrastructure definitions. Repository access reflects the requested scopes and what the account is allowed to reach rather than a feature of Copilot CLI itself. The Copilot CLI client ID is public and is not a secret.

GitHub Copilot CLI can, depending on setup, work with code, execute commands on a user’s computer, keep context across sessions, and let an active session be guided from afar. Researchers could steer an active Copilot CLI session from a distance when the user turned on remote control, organization policy permitted it, and local permissions and approval prompts allowed. That steering could make the agent run commands on the user’s computer, subject to session approval prompts and local operating-system permissions.

The remote steering is not unauthenticated remote code execution. It does not work when remote control is off, the session is not running, or the computer is offline.

Researchers also put misleading entries into Copilot Memory using the agent’s slash-memory command, and if those entries are used later, the effect can last beyond the first sign-in. When cloud session storage is on, they could read the test account’s Copilot CLI sessions stored in the cloud, including sessions that happened before the test. Those saved sessions may hold code snippets, file paths, architecture talks, and other work background. For Copilot Business and Enterprise, cloud session storage depends on the organization’s session-storage policy, and saving a session in the cloud does not by itself turn on remote control.

Microsoft said the results are a proof of concept showing that existing features working as intended could be misused after a phished authorization, and the company has not seen these attacks in the wild. Microsoft also said it did not observe the four outcomes in the Storm-2372 or EvilTokens campaigns or in the wild.

Microsoft says it has seen device code phishing used against accounts in campaigns such as Storm-2372, an AI-enabled campaign in 2026, and EvilTokens. Microsoft and industry and law enforcement partners disrupted the EvilTokens campaign in September 2026.

Huntress‘s security operations center uncovered an incident in which attackers used a bogus Microsoft Teams meeting scheduler to deceive a construction company worker into approving the device-code sign-in. The attackers captured a valid session token before Huntress became aware. Device code phishing abuses the real Microsoft sign-in flow: the attacker begins a sign-in, receives a short code, and talks the victim into typing it on Microsoft’s genuine device login page. The victim types the code, finishes multifactor authentication if asked, and without realizing it approves the attacker’s session, which gives the attacker access tokens for the victim’s account.

Push Security said it detected and blocked visits to malicious AI event registration pages impersonating OpenAI, SpaceX, and Anthropic on its customers’ browsers in late October 2026. One fake OpenAI event promoted a November 4 livestream named ChatGPT for Social & Digital Marketing Teams and offered three months of ChatGPT Pro. Another fake page advertised an invitation-only SpaceX briefing planned for November 12 with a choice of three months of Grok Heavy or a SpaceX share.

Push Security said it did not claim that OpenAI, SpaceX, or Anthropic ran the fraudulent events. The fake sites tell visitors they must sign in with a corporate Microsoft or Google account to finish registration and collect the rewards. Choosing Continue with Microsoft makes the phishing site connect to Kali365, a phishing-as-a-service platform that creates a Microsoft device authentication code.

The fake registration page tells the visitor to copy that code and type it on Microsoft’s legitimate sign-in website. Once the victim types the supplied code and approves, Microsoft can issue authentication tokens to the attacker’s session. Those tokens may reach Microsoft 365 resources without the attacker knowing the account password.

Push Security found that after the device code step, the campaign sends Microsoft users to VoidProxy, a second phishing service that tries to capture passwords and authenticated session cookies. Push Security recorded the malicious infrastructure and stopped access to the phishing pages, yet its report did not state whether any accounts were compromised.

Two phishing kits used for the fake event pages, ZoomMock and MSDRoot, were identified by Push Security, which found evidence that the same operators may have run both, though the link was not proven. Push Security found no evidence tying the creators of Kali365 and VoidProxy together and thinks the campaign operators are customers of both services.

Microsoft said its Defender product has detections to block the threats from the report. A Microsoft spokesperson said, “Microsoft Defender includes detections to block the threats identified in the report.”

Two detection mechanisms created by the company flag phishing attempts against GitHub Copilot CLI device code delivered by e-mail or Microsoft Teams. The detections link suspicious messages and clicks to later GitHub OAuth token creation and regeneration events to catch potentially unauthorized Copilot CLI approvals that might look legitimate.

A disruption action created by the company covers GitHub Enterprise Managed Users and suspends the affected managed identity via the organization’s identity provider, cutting off the attacker’s access. Microsoft checked the disruption capability in a research setting. Whether detection and disruption are available depends on the supported setup, needed telemetry, identity integration, and deployment requirements.

The company mapped the lab behaviors to MITRE ATT&CK T1566.002 for spearphishing link initial access. Microsoft said the mappings describe the simulation, not an attributed campaign.

People should only type a device code for a sign-in they began themselves, and any unexpected request to verify GitHub or turn on Copilot should be treated as phishing even if the page is on github.com. GitHub’s verification page tells users not to use a code that another person sent.

Microsoft recommends turning on Safe Links in Microsoft Defender for Office 365 for e-mail and confirming Safe Links coverage for Microsoft Teams. For organization-provided Copilot CLI seats, GitHub’s Store local sessions in the Cloud policy controls whether sessions can be stored and controlled remotely.

The company recommends reviewing authorized OAuth applications in GitHub account settings, canceling approvals that are unexpected or no longer needed, and limiting repository access using suitable organization roles. When Copilot Memory is enabled, GitHub’s memory-management controls can be used to review and remove repository facts or preferences, but disabling memory does not erase stored entries.

For investigations, the company recommends linking GitHub Enterprise Cloud to Defender for Cloud Apps and confirming what activity is available in your environment before depending on it. The GitHub Enterprise Cloud connector in Microsoft Defender for Cloud Apps lets organizations see GitHub activity that helps investigations of suspicious authorization patterns.

As AI agents reach repositories, session history, and local tools, the effect of a phished authorization depends more on what those agents can access. The reach of the access depends on the account and permissions and may include e-mail, files, and cloud services.

Microsoft advises limiting device code authentication where it is not needed, and administrators can apply those limits through Microsoft Entra Conditional Access policies after reviewing legitimate business needs. For stronger protection, choose phishing-resistant sign-in methods like FIDO2 security keys or supported passkeys.

Was this helpful?

Join the discussion

Please read our Comment Policy before commenting. First-time comments are held for moderation. By posting a comment you agree to our Terms of Use and Privacy Policy, which explain how your name, email address and comment are used.

Your email address will not be published. Required fields are marked *