Threat reportVulnerabilityTL-2026-6261
Device Code Phishing Abuse Against AI Coding Agents (GitHub Copilot CLI) - Microsoft Security Research
Microsoft Security Research demonstrated in a controlled lab that a victim who approves a phished GitHub device code gives an attacker-controlled client OAuth access to the victim's GitHub account via the GitHub Copilot CLI sign-in flow. Lab outcomes were steering an active remote-enabled session, injecting misleading Copilot Memory entries, reading cloud-synced sessions, and accessing private repositories.
Key facts
| Identifiers | TL-2026-6261 |
|---|---|
| Also known as | Copilot CLI device code phishing, AI coding agent device code abuse |
| Severity | MEDIUM |
| First disclosed | |
| Affected products | GitHub (Microsoft) GitHub Copilot CLI (device code authentication, remote control, Copilot Memory, cloud session storage) |
| Malware | RemoteControl |
| Tools | EvilTokens, GitHub Copilot CLI |
| MITRE ATT&CK techniques | T1059 Command and Scripting Interpreter, T1078.004 Cloud Accounts, T1204.001 Malicious Link, T1213.003 Code Repositories, T1528 Steal Application Access Token, T1530 Data from Cloud Storage, T1550.001 Application Access Token, T1565.001 Stored Data Manipulation, T1566.002 Spearphishing Link |
| Motivation | UNKNOWN |
| Target sectors | technology, software development |
| Target regions | Global |
| Detection rules | 9 (1 shown free) |
| Sources | 14 cited sources |
Detection coverage
As of 2026-11-17, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-6261 across Splunk SPL, Microsoft KQL and Sigma, covering 9 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.
Free detection: GitHub Copilot CLI OAuth Grant With Broad Scopes (Device Code Phishing Exploitation)
Behaviour-first detection for TL-2026-6261 (T1528 / T1550.001 / T1078.004). In Microsoft's lab, the victim approves an attacker-initiated GitHub device code and the attacker's client receives an OAuth token for the GitHub Copilot CLI app with scopes repo, read:user, read:org, gist and codespace. The authorization shows under a legitimate app name on the genuine github.com verification page, so the GitHub audit log event for the OAuth grant is the reliable server-side signal. Alerts when a Copilot app authorization carries at least three of repo/read:org/gist/codespace so analysts can confirm with the user that they started the sign-in themselves.
- Languages: Splunk SPL, Microsoft KQL, Sigma
- ATT&CK: T1528, T1550.001, T1078.004
- Data sources: github_enterprise_audit_log (index=github, sourcetype=github:cloud:audit), defender_for_cloud_apps_github_connector (CloudAppEvents)
- Severity: high
- Confidence: high
Splunk SPL
index=github sourcetype="github:cloud:audit" earliest=-24h (action="oauth_authorization.create" OR action="oauth_access.create" OR action="oauth_access.regenerate")
| eval app=lower(coalesce(application_name, oauth_application_name, "unknown"))
| where like(app, "%copilot%")
| eval scopes=lower(mvjoin(coalesce(token_scopes, scopes, ""), ","))
| eval scope_hits=if(match(scopes, "(^|[^a-z:_])repo([^a-z:_]|$)"), 1, 0) + if(like(scopes, "%read:org%"), 1, 0) + if(like(scopes, "%gist%"), 1, 0) + if(like(scopes, "%codespace%"), 1, 0)
| where scope_hits>=3
| stats count earliest(_time) as first_seen latest(_time) as last_seen values(action) as actions values(scopes) as granted_scopes values(actor_ip) as src_ip values(user_agent) as user_agent by actor, app
| convert ctime(first_seen) ctime(last_seen)Microsoft KQL
CloudAppEvents
| where Timestamp > ago(24h)
| where Application =~ "GitHub"
| where ActionType in~ ("oauth_authorization.create", "oauth_access.create", "oauth_access.regenerate")
| extend Raw = parse_json(tostring(RawEventData))
| extend AppName = tolower(coalesce(tostring(Raw.application_name), tostring(Raw.oauth_application_name), "")),
Scopes = tolower(tostring(Raw.token_scopes)),
Actor = coalesce(tostring(Raw.actor), AccountDisplayName)
| where AppName has "copilot"
| extend ScopeHits = toint(Scopes matches regex @"(^|[^a-z:_])repo([^a-z:_]|$)") + toint(Scopes contains "read:org") + toint(Scopes contains "gist") + toint(Scopes contains "codespace")
| where ScopeHits >= 3
| summarize FirstSeen = min(Timestamp), LastSeen = max(Timestamp), Events = count(), Actions = make_set(ActionType), SourceIPs = make_set(IPAddress) by Actor, AppName, ScopesSigma
title: GitHub Copilot CLI OAuth Authorization With Broad Scopes (Device Code Phishing)
id: 3f2b8a64-6c1e-4d0b-9a57-1e4c7d2a9b10
status: experimental
description: Detects creation or regeneration of an OAuth authorization for a GitHub Copilot application carrying the repo, read:org, gist and codespace scope set used in the Microsoft device-code phishing lab (TL-2026-6261). A phished victim approving an attacker-initiated device code produces this audit event under a legitimate application name.
references:
- https://www.microsoft.com/en-us/security/blog/2026/11/17/the-risks-of-device-code-authentication-for-ai-coding-agents/
- https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps
author: Threadlinqs Team
date: 2026-11-17
tags:
- attack.credential-access
- attack.t1528
- attack.defense-evasion
- attack.t1550.001
- attack.initial-access
- attack.t1078.004
logsource:
product: github
service: audit
detection:
selection_action:
action:
- 'oauth_authorization.create'
- 'oauth_access.create'
- 'oauth_access.regenerate'
selection_app:
application_name|contains: 'copilot'
selection_scope_repo:
token_scopes|contains: 'repo'
selection_scope_org:
token_scopes|contains: 'read:org'
selection_scope_gist:
token_scopes|contains: 'gist'
selection_scope_codespace:
token_scopes|contains: 'codespace'
condition: selection_action and selection_app and 3 of selection_scope_*
falsepositives:
- Developers legitimately signing in to Copilot CLI with the default broad scope set
- Onboarding waves for new engineering hires
level: medium
Known false positives:
- Developers legitimately signing in to GitHub Copilot CLI who started the device flow themselves
- Mass onboarding of engineers to Copilot CLI producing many grants with the default scope set
Tuning notes: Confirm the field names in your GitHub audit ingestion (application_name, token_scopes, actor_ip) and adjust the coalesce lists. Raise or lower the scope_hits threshold, allowlist actors during planned Copilot rollouts, and enrich with the user's recent email/Teams link clicks (see TL-2026-6261-KQL-003). Audit log streaming must be enabled for GitHub Enterprise Cloud.
- User Click On GitHub Device Verification Link From Email Or Teams (Device Code Lure) · unlock with TL Creds
- Copilot CLI Agent Spawns Shell With Credential Or Exfiltration Commands (Remote Steering) · unlock with TL Creds
- Device Code Link Click Followed By GitHub OAuth Token Creation (Phish-To-Token Correlation) · unlock with TL Creds
- Device Code Lure: GitHub Device Verification Link Delivered By Email Or Teams · unlock with TL Creds
- Copilot CLI Local State Tampering By Non-Agent Process (Memory/Instruction Poisoning Heuristic) · unlock with TL Creds
- Unexpected Client Initiating GitHub OAuth Device Flow (Device Code Tooling) · unlock with TL Creds
- OAuth Token Mass Private Repository Clone/Fetch (Post-Exploitation Repo Access) · unlock with TL Creds
- GitHub OAuth Token Activity From Previously Unseen IP (Attacker Client Using Phished Token) · unlock with TL Creds
Indicators of compromise
As of 2026-11-17, Threadlinqs Intelligence tracks 9 indicators of compromise for TL-2026-6261.
Sample indicators (1 of 9)
- Domain:
github[.]com
Defanged, TLP:CLEAR. Full set of 9 indicators: unlock with TL Creds.
Technical analysis
Microsoft states these outcomes were not observed in the wild.
Microsoft Security Research (Uri Oren, Dor Edry) published on 2026-11-17 a lab proof of concept showing how OAuth device authorization (device code) phishing can be turned against AI coding agents. The device flow lets a client without a browser obtain a token after a user enters a short code on the service's real verification page. In the lab the attacker started a device-code sign-in using the Copilot CLI public client (any public client supporting the device flow would work), chose the requested scopes (repo, read:user, read:org, gist, codespace), and sent the victim the short code plus the genuine GitHub verification link under a pretext such as an IT request or a Copilot license check. Because the page is genuinely hosted by GitHub and the authorization appears under a legitimate application name, neither the domain nor the app name reveals who initiated the request. Once the victim approved, the attacker's client signed in automatically and operated within the granted permissions.
Microsoft analyzed four outcomes, each dependent on account permissions, enabled features and organization policy. (1) Remote steering: when remote control is enabled for a session, allowed by org policy, and the interactive session is active and online, the attacker can steer it; commands run on the victim machine subject to session approval prompts and local OS permissions. This is misuse of an authorized feature, not unauthenticated remote code execution. (2) Copilot Memory poisoning: misleading entries can be added through the agent's /memory command, can influence later interactions and outlast the sign-in; disabling memory does not delete existing entries. (3) Cloud session exposure: where cloud session storage is enabled, synced Copilot CLI sessions (including older ones) were readable and may hold code snippets, file paths and architecture discussions. (4) Private repository access follows the account's repository permissions and can expose application code and infrastructure definitions.
The post maps the PoC to MITRE ATT&CK T1566.002 (Spearphishing Link) and T1528 (Steal Application Access Token). It references earlier device code phishing campaigns (Storm-2372, an AI-enabled campaign in April 2026, and EvilTokens) but states the Copilot CLI outcomes were not seen in them. Microsoft Defender XDR provides two detections, 'Suspected GitHub Copilot CLI device code phishing via email' and 'via Microsoft Teams', which require the GitHub Enterprise Cloud connector in Defender for Cloud Apps and correlate suspicious messages and clicks with GitHub OAuth token creation and regeneration events; for GitHub Enterprise Managed Users a disruption action can suspend the managed identity through the IdP (validated in the research environment only). No CVE, CVSS score, attributed actor or network IOCs exist for this research; severity is an analyst estimate. The IOC list therefore contains documented protocol endpoints, scope strings and behavioral indicators useful for hunting, not attacker infrastructure.
MITRE ATT&CK techniques by tactic:
Execution
T1059 Command and Scripting Interpreter; T1204.001 Malicious Link
Initial Access
T1078.004 Cloud Accounts; T1566.002 Spearphishing Link
Collection
T1213.003 Code Repositories; T1530 Data from Cloud Storage
Credential Access
T1528 Steal Application Access Token
lateral-movement
T1550.001 Application Access Token
Impact
Remediation
Patches
- No vendor patch or CVE: this is abuse of the legitimate OAuth device flow and Copilot CLI features
Immediate actions
- Review authorized OAuth apps in GitHub account and organization settings and revoke unexpected authorizations
- After a suspected phish, investigate affected Copilot CLI sessions, repositories and saved Copilot Memory entries
- Tell users to enter a device code only for a sign-in they started themselves and to treat unexpected 'verify GitHub' or 'activate Copilot' requests as phishing, even on github.com
Workarounds
- Review the 'Store local sessions in the Cloud' policy, which governs cloud session storage and remote control, and choose the least permissive setting that supports workflows
- Configure Safe Links in Defender for Office 365 for email and verify Safe Links for Microsoft Teams (does not stop a legitimate verification URL used in a lure)
- For GitHub Enterprise Managed Users, use the Defender disruption action that suspends the managed identity through the IdP
Longer-term hardening
- Connect the GitHub Enterprise Cloud connector to Microsoft Defender for Cloud Apps and validate available activity telemetry before relying on it
- Limit repository access through organization repository roles (least privilege)
- Review and remove suspicious Copilot Memory facts or preferences with the memory management controls, since disabling memory leaves existing entries in place
Affected and fixed versions
- GitHub (Microsoft) — GitHub Copilot CLI (device code authentication, remote control, Copilot Memory, cloud session storage)
Vulnerable versions: Accounts authenticating via the OAuth device flow with the features enabled (remote control, cloud session storage, Copilot Memory)
Timeline
- Microsoft publishes analysis of Storm-2372's device code phishing campaign, an earlier real-world abuse of the same OAuth device flow (against Microsoft accounts).
- Microsoft publishes 'Manipulating AI memory for profit: the rise of AI Recommendation Poisoning', related research on poisoning AI assistant memory.
- Microsoft publishes analysis of an AI-enabled device code phishing campaign (April 2026).
- Microsoft On the Issues blog describes disruption of EvilTokens with partners and law enforcement.
- Microsoft publishes 'Unmasking EvilTokens' on the device code phishing kit and its operations.
- Microsoft Security Research publishes the Copilot CLI device code phishing lab simulation covering session steering, Copilot Memory injection, cloud session reading and private repo access; states the outcomes were not observed in the wild.
Sources cited
- Authorizing OAuth apps - device flow (GitHub Docs) GitHub · Advisory
- Authenticating GitHub Copilot CLI (GitHub Docs) GitHub · Advisory
- About remote control of Copilot CLI sessions (GitHub Docs) GitHub · Advisory
- Copilot CLI session data / cloud sync (GitHub Docs) GitHub · Advisory
- Managing Copilot Memory as an administrator (GitHub Docs) GitHub · Advisory
- Reviewing your authorized OAuth apps (GitHub Docs) GitHub · Advisory
- The risks of device code authentication for AI coding agents (Microsoft Security Blog) Microsoft · Research · 2026-11-17
- Storm-2372 conducts device code phishing campaign (Microsoft) Microsoft · Vendor report · 2025-02-13
- AI-enabled device code phishing campaign, April 2026 (Microsoft) Microsoft · Vendor report · 2026-04-06
- Unmasking EvilTokens: getting to the root of device code phishing (Microsoft) Microsoft · Vendor report · 2026-09-22
- Protect your GitHub Enterprise environment (Defender for Cloud Apps) Microsoft · Vendor report
- Configure Safe Links policies (Defender for Office 365) Microsoft · Vendor report
- Manipulating AI memory for profit: the rise of AI Recommendation Poisoning (Microsoft) Microsoft · Blog · 2026-02-10
- Disrupting EvilTokens: the AI chatbot built for cybercrime (Microsoft On the Issues) Microsoft · News · 2026-09-22
Drafted by the Threadlinqs research pipeline from 14 sources; published ; last updated —.