Skip to content

Response, New York. Noah Park: Check Point Patches Actively Exploited Management Server Path Traversal. Detection, Dallas. Ava Okello: Report Finds Nearly Half of Deployed Detections Need Attention Before SOCs Can Trust Them.

SOCtember

Always First. Fast SOC News.

Microsoft diagram titled Device code phishing showing five steps: the attacker requests a code from a CLI or API, sends a lure, the user approves, the token goes to the attacker, and the attacker acts within the granted OAuth permissions.
Image: Microsoft (fair use). Figure 1 from the Microsoft Security blog post on device code authentication risks for AI coding agents, published Nov. 17, 2026. Conceptual illustration.

Detection

Microsoft Shows How One Phished Device Code Could Let an Attacker Steer a GitHub Copilot CLI Session, Plant False Agent Memories and Read Private Repositories, and Ships Two Defender Detections for It

The lab study, which Microsoft says reflects no attack seen in the wild, starts with a sign-in on the real github.com page. The new Defender XDR alerts tie a phishing email or Teams message to the GitHub OAuth token created afterward, and a disruption action can suspend the managed identity.

Ava Okello, DetectionLondon5 min read

LONDON - Device code phishing, a recurring route to account takeover in campaigns such as EvilTokens, could do far more damage when the account it captures belongs to a developer running an AI coding agent, Microsoft security researchers said in a study published Tuesday.

Using GitHub Copilot CLI as the example, researchers Uri Oren and Dor Edry had a test account approve a GitHub device-code request started by a client they controlled. With that one approval they could steer an active Copilot CLI session, add misleading entries to the agent's memory, read sessions synced to the cloud and reach private repositories the account could access. Microsoft stressed that these were proof-of-concept results from a controlled simulation, that the features worked as designed, and that it has "not observed the four outcomes below" in earlier device-code campaigns or in the wild.

The technique is not specific to GitHub. Any public client that supports the OAuth device flow can be abused the same way, the researchers wrote, and the attacker chooses the scopes when starting the flow. In the lab, the request asked for repo, read:user, read:org, gist and codespace.

The approval happens on the real site

In device code phishing, the attacker starts a sign-in, then sends the short code and GitHub's genuine verification link to the target, perhaps dressed up as an IT request or a Copilot license check. The victim signs in on github.com and approves; the attacker's client finishes the sign-in automatically. "The legitimate verification page is part of the story, not evidence that the request was safe," Microsoft wrote.

Microsoft diagram titled One approved code, four impacts, showing an illicitly granted authorization at the center linked to remote control of an active session, memory poisoning of persistent context, session exposure of cloud-synced data and repository exfiltration.
Image: Microsoft (fair use).The four possible outcomes Microsoft examined in its lab, each subject to the account's permissions and enabled features. Conceptual illustration.

Each outcome had limits. Remote steering works only if the user has enabled remote control for a running, online session and organization policy allows it, and the agent's commands remain subject to local approval prompts and operating system permissions; Microsoft said it is "not unauthenticated remote code execution." Memory poisoning depends on Copilot Memory being on, and synced sessions are readable only where cloud session storage is enabled. Repository access reflects the requested scopes and the account's own permissions.

Two new alerts and a disruption action

Microsoft said it built two Defender XDR detections from the research: Suspected GitHub Copilot CLI device code phishing via email, and the same via Microsoft Teams. Both correlate suspicious messages and clicks with GitHub OAuth token creation and regeneration events that follow, using GitHub activity from the GitHub Enterprise Cloud connector in Defender for Cloud Apps. For GitHub Enterprise Managed Users, a disruption action suspends the affected managed identity through the organization's identity provider.

Screenshot of a Microsoft Defender incident in the SOC view titled Suspected GitHub Copilot CLI device code phishing via email, with an incident graph highlighted.
Image: Microsoft (fair use).A Microsoft Defender alert for suspected GitHub Copilot CLI device code phishing via email, from the Microsoft post.

For teams without those products, the same correlation can be built by hand: a message or click to github.com/login/device followed shortly by a new OAuth authorization for a CLI client on that user's account. In our reading, the cleanest indicator is an authorization granted to a client the user did not start, which is why GitHub's own page warns never to use a code sent by someone else.

Microsoft diagram titled Containment and recovery showing a research model of four steps: identify the Enterprise Managed User, suspend the account, verify blocking, and review and restore.
Image: Microsoft (fair use).Microsoft's research model for containing an affected managed identity. Conceptual illustration.

What to change now

Microsoft's guidance: tell everyone who uses developer and AI tools to enter a device code only for a sign-in they started; configure Safe Links for email and Teams; set GitHub's "Store local sessions in the Cloud" policy for Copilot CLI to the least permissive option workflows allow; review and revoke unexpected OAuth authorizations and limit repository access by role; and connect GitHub Enterprise Cloud to Defender for Cloud Apps and confirm the activity is visible before relying on it.

During an incident, responders should revoke unexpected OAuth authorizations, verify access is blocked, and investigate affected sessions, repositories and saved memory. Disabling Copilot Memory does not delete entries already stored, Microsoft noted, so the saved content needs a manual review.

About the Author

Ava Okello

Ava Okello covers detection engineering, EDR telemetry, and SOC hunting for SOCtember from London.

Related stories

Detection desk