One-click VS Code attack can steal GitHub tokens from GitHub.dev

by

Cybersecurity researchers on June 2, 2026 disclosed a one-click attack against GitHub.dev in Microsoft Visual Studio Code that can steal a GitHub OAuth token with access to private repositories, according to a technical analysis.

KEY FACTS

  • Attack path A malicious link can trigger the token theft.
  • Target The issue affects GitHub.dev in the browser, not VS Code Desktop.
  • Impact The token can access other repositories, including private ones.
  • Technique The exploit uses a webview and keypress simulation to install an attacker extension.
  • Mitigation gap Local workspace extensions can bypass the publisher trust prompt.

GitHub.dev runs a lightweight VS Code environment in the browser and passes an OAuth token from github.com so it can act on a user’s behalf. The disclosure said that token is not limited to the repository a person opened, which leaves access to any other repository the user can reach.

The attack relies on malicious JavaScript inside an untrusted webview. It can simulate keydown events, open the Command Palette, and install an attacker-controlled extension that captures the token when it is sent to GitHub.dev.

The report said the same approach can also use local workspace extensions, which can be placed in the .vscode/extensions folder and installed without the usual trust prompt. The researcher said GitHub was notified on June 2, 2026, and Microsoft has acknowledged the issue and said it is working on a fix.

Alexandru Dima of Microsoft said the issue does not affect VS Code Desktop. The report did not say when a patch would be released.

WHY IT MATTERS

The flaw could let an attacker gain broad access to a developer’s GitHub repositories after a single click. That raises the risk of source code exposure and unauthorized changes until the browser-based editor is updated.