MilikMilik

How a VS Code Exploit Exposed GitHub Tokens on github.dev

How a VS Code Exploit Exposed GitHub Tokens on github.dev
Interest|High-Quality Software

What the github.dev VS Code exploit was and why it mattered

The github.dev VS Code exploit was a security flaw where a malicious link opened in GitHub’s browser editor could steal a broad OAuth token and turn that single click into access to multiple GitHub private repositories the victim could reach. At its core, this was a GitHub token theft issue: github.com sends an OAuth token to github.dev so the online editor can act on behalf of the signed-in user, and the disclosed attack chain abused that delegation. Security researcher Ammar Askar released proof-of-concept exploit code describing how a compromised github.dev session could grab that authentication token. According to Ammar Askar, “The token is not scoped to the particular repo you interacted with, meaning it has full access to every other repo that you have access to.” Microsoft says the issue has been mitigated for its services and that no customer action is required.

How the attack chain worked: from webview tricks to token theft

The exploit combined several behaviors in the VS Code web-based environment. First, VS Code webviews can render HTML for extensions inside the editor. The reported chain showed how a malicious webview could synthesize keyboard events, open the command palette, and drive commands that installed attacker-controlled extension code. Attackers could then place a local workspace extension under .vscode/extensions, avoiding the usual trusted-publisher prompt that protects against unknown publishers. Once the exploit extension ran, it could read the GitHub API token that github.dev received for the session and use it to query the GitHub API, listing private repositories available to the compromised account. Microsoft’s VS Code issue #319593 tracks the root security problem as arbitrary webview shortcuts in the main workbench. Microsoft clarified that this path affects browser-based github.dev and “does not affect VS Code Desktop,” although Askar noted the webview issue also exists on desktop in a harder-to-exploit form.

What Microsoft fixed—and what developers should still review

Microsoft states that the VS Code security vulnerability used on github.dev was mitigated for its services on June 3, 2026, and that no customer action is required. That mitigation should block the original one-click path from a malicious github.dev link to GitHub token theft and unauthorized repository access. However, the incident still matters for anyone concerned with OAuth token protection and GitHub private repositories. Even if this specific flaw is closed, it showed how much power a browser session token can hold when its scope is broader than a single project. Developers who used github.dev heavily around the disclosure date may still choose to review recent GitHub access logs for unusual repository queries or extension activity. The proof-of-concept repository tied to Askar’s disclosure underlines the practical risk: one stolen web token can become a window into every repository the victim can access.

Protecting OAuth tokens: practical steps for GitHub users

This incident is a reminder that GitHub token theft is not theoretical and that OAuth token protection needs constant attention. Start by regularly reviewing and pruning authorized OAuth applications in your GitHub account; remove anything you do not recognize or no longer use. Revoke old or suspicious tokens so they cannot be used even if stolen. Enable two-factor authentication on GitHub to make it harder for attackers to escalate from a single credential leak. Be cautious with extensions: only install VS Code extensions from publishers you trust, and audit workspace-local extensions under .vscode/extensions, where exploit code in this case could hide. When clicking github.dev links, treat unknown repositories and unexpected prompts with suspicion. While Microsoft has patched this specific VS Code security vulnerability, similar token-theft attack patterns have already appeared in AI coding agents and malicious extensions targeting code, API keys, and proprietary algorithms.

Lessons from recent developer-tool attacks on repositories and credentials

The github.dev flaw sits in a broader pattern of attacks on developer tools and GitHub private repositories. The same ecosystem that speeds up coding—browser editors, AI coding agents, and rich extensions—also carries access tokens and sensitive source. Previous incidents include poisoned VS Code extensions exposing internal repositories at GitHub, developer-tool supply-chain malware spreading across GitHub, npm, and the VS Code extension marketplace, and malicious VS Code extensions linked to theft from 1.5 million developers. Although separate from the github.dev exploit, they share a theme: extensions and automated agents can silently act on behalf of the user. For security teams, that means treating OAuth tokens and extension permissions as critical assets, not background details. Regularly audit which tools can read repository contents, where tokens are stored in browser sessions, and how easily a compromised extension could pivot from a single project into your entire organization’s codebase.

Milik earns a commission when you shop through our links, at no extra cost to you. Editorial content is independently selected by our team.

You May Also Like

Comments
Say something...
No comments yet. Be the first to share your thoughts!