The risks of device code authentication for AI coding agents
Source Microsoft Security Blog
Description
Device code phishing is a social engineering attack where an attacker initiates an OAuth device flow sign-in request and persuades a user to approve it, granting access to the attacker. This technique was demonstrated in a controlled simulation targeting GitHub Copilot CLI, an AI coding agent that uses OAuth device flow for authentication. Approval of the device code by the user can allow an attacker to remotely control active Copilot CLI sessions, manipulate the agent's memory, read synchronized sessions, and access private repositories. These outcomes depend on user permissions and enabled features. The attack leverages legitimate OAuth flows and does not involve password theft. Microsoft Defender can detect such attacks by correlating phishing attempts with GitHub authentication activity. The technique is not specific to GitHub and can affect any public client supporting OAuth device flow.