MilikMilik

VS Code github.dev Exploit Put Private GitHub Repos at Risk

VS Code github.dev Exploit Put Private GitHub Repos at Risk
Interest|High-Quality Software

What the github.dev Exploit Was and Why It Mattered

The github.dev exploit was a Visual Studio Code browser-based vulnerability where a single malicious repository link could trigger a chain of events that stole a user’s GitHub OAuth token, potentially granting attackers access to private repositories and sensitive code through the same permissions as the victim’s authenticated session. At the center of this GitHub token theft risk was how github.dev, the in-browser code editor, received an OAuth token broad enough to act on behalf of the signed-in user across multiple repositories. When a user opened a repository via github.dev, GitHub.com issued this delegated credential so the editor could read, modify, and commit code without asking for a password again. Security researcher Ammar Askar’s disclosure showed that if attackers could hijack that token, they could reach every repository the victim account could access, not just the one linked in the browser.

How Attackers Exploited VS Code Webviews to Steal Tokens

The VS Code vulnerability stemmed from how webviews render HTML inside the editor for extensions. Askar’s proof-of-concept showed that a malicious webview could synthesize keyboard events, open the command palette, and execute commands that installed attacker-controlled extension code. From there, attackers could use local workspace extensions under .vscode/extensions to bypass the usual trusted-publisher prompt, silently loading a malicious extension into the github.dev session. That extension could then read the GitHub API token and call GitHub APIs to list private repositories or access code. Microsoft’s VS Code issue #319593 describes the root problem as arbitrary webview shortcuts in the main workbench. According to Microsoft partner software engineering manager Alexandru Dima, “this issue does not affect VS Code Desktop,” which keeps the direct one-click attack surface limited to browser-based github.dev rather than all desktop users.

Who Was at Risk and What Has Been Fixed

The github.dev exploit mainly threatened developers who clicked a malicious repository link that opened in the browser-based editor while signed into GitHub. Because the OAuth token had wide scope, once stolen it could give attackers the same access the victim had, including private repositories and internal company code. Askar noted that the underlying webview issue also exists in VS Code Desktop, but it is harder to exploit because an attacker must trick a user into cloning a repository and opening a booby-trapped notebook. Microsoft states that the issue was mitigated for its services on June 3, 2026, and that no customer action is required. Before that mitigation, Askar recommended clearing github.dev site data; with the fix in place, the immediate github.dev exploit path for GitHub token theft has been closed on Microsoft’s side.

Practical Steps to Protect Your GitHub OAuth Tokens

Even with the VS Code vulnerability mitigated, this incident is a reminder to treat OAuth token security as seriously as passwords. First, review your GitHub account’s authorized OAuth apps and tokens, and revoke any access you do not recognize or no longer need. Narrow scopes wherever possible so tokens only grant the minimum repository and action permissions required for a tool to work. Rotate tokens used in CI/CD pipelines and development tools on a regular schedule. Avoid storing tokens in source code or configuration files committed to repositories; use environment variables and secret managers instead. Monitor GitHub security logs for unusual access patterns, such as token usage from unexpected IPs or actions against unfamiliar repositories. Finally, educate teams that any token exposed through logs, screenshots, or compromised extensions should be treated as fully compromised and revoked immediately.

Avoiding Social Engineering and Extension-Based Credential Theft

Most github.dev exploit chains start with social engineering: a crafted link to a repository or file that a developer is persuaded to open. Be cautious with unsolicited links sent via chat, email, or issue trackers, especially when they point to unfamiliar repositories. Check extension publishers before installing or enabling new VS Code extensions, and periodically review installed extensions to remove ones you do not use. Recent incidents involving poisoned VS Code extensions, developer-tool supply-chain malware, and AI coding agents tricked into exfiltrating credentials show that tools acting on your behalf can become attack paths. Treat any extension or agent that can read files, run code, or call APIs as a potential channel for GitHub token theft. Establish internal guidelines that restrict which extensions are approved and require code review or security assessment for tools that access private repositories.

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!