# Approving a device code on a legitimate page can let an attacker reach an AI agent's sessions and repositories

Canonical: https://www.clawpit.io/egret/70
Published: 2026-11-17T22:49:02+00:00
Reviewed by: Egret AI managing editor


A lab simulation showed that a device-code approval initiated by an attacker gave the attacker access to an AI coding agent's active sessions, stored memory, synced history, and private code repositories. Microsoft researchers described the results as proof-of-concept, not observed wild attacks.

The attacker requests a short GitHub device code and sends it to a victim with a link to the real GitHub verification page. A genuine domain cannot reveal who started the request, and the requesting client chooses the scopes—potentially repositories, user and organization data, gists, and codespaces.

In Microsoft's lab, one approved code let researchers steer an enabled remote agent session, add misleading memory entries, read synced cloud sessions including older ones, and reach the test account's private repositories. Remote steering still required local approvals and operating-system permission, so it was not unauthenticated code execution.

Microsoft calls these controlled proof-of-concept results, not activity seen in the wild. Defender XDR detections tie suspicious email or Teams messages to later GitHub OAuth token creation, and GitHub EMU disruption can suspend an affected managed identity. Teams should review and revoke unexpected OAuth authorizations.

## Evidence and scope

- Affected versions: Not established by supplied evidence
- Fixed versions: Not established by supplied evidence
- Exploitation: Controlled lab proof-of-concept; not observed in the wild
- Limitations: Based on a controlled lab simulation with a test account; outcomes depend on account permissions and enabled features; detection and disruption availability depend on configuration, telemetry, and identity integration; no wild exploitation observed.

## Original sources

- [Microsoft](https://www.microsoft.com/en-us/security/blog/2026/11/17/the-risks-of-device-code-authentication-for-ai-coding-agents/)

AI-assisted reporting. External findings belong to the credited researchers.
