GitHub Exposes Developers’ OAuth Tokens, Microsoft Deploys Mitigation

Security Researcher Exposes One-Click GitHub OAuth Token Theft via github.dev

A security researcher has publicly revealed a one-click attack method that allows attackers to steal a developer’s GitHub OAuth token through github.dev, the web-based version of Visual Studio Code. This stolen token provides unauthorized read and write access to all repositories of the victim, including private ones. Microsoft quickly deployed a mitigation strategy just a day after the disclosure, stating that its services are now protected.

The details of the attack were disclosed by researcher Ammar Askar on June 2, who provided a demonstration code and notified GitHub’s security teams just an hour prior to the announcement. “By simply clicking a link, an attacker can steal a GitHub token that can read and write to your repositories, including private ones,” Askar wrote on his blog. This attack specifically targets github.dev, which enables users to work on GitHub repositories without needing a local installation of the code editor. According to Alexandru Dima, a software engineering manager at Microsoft, the desktop version of the editor remains unaffected.

At the heart of the issue is a token that github.com transmits to github.dev upon opening the web editor. This OAuth token allows the editor to act on behalf of the user, granting access to all repositories tied to the account, instead of just the repository currently opened in the session. Anyone who intercepts this token gains full rights to the victim’s codebase, enabling them to read, modify, or exfiltrate data via the API.

Exploitation Chain Manipulates Command Palette

The exploitation chain relies on the messaging mechanism between the main editor window and its webviews, which are interface zones that render Markdown previews or Jupyter notebooks. A malicious script executed in an untrusted webview simulates keystrokes in the main window, opens the command palette, and initiates the installation of an attacker-controlled extension. Once installed, the extension extracts the OAuth token transmitted to github.dev and queries the GitHub API to list all accessible private repositories.

The exploitation bypasses the trusted publisher verification by utilizing local workspace extensions—a feature that installs any extension located in the project’s vscode/extensions folder without a confirmation dialog. Furthermore, the extension can declare its own keyboard shortcuts, enabling it to invoke any editor command while bypassing existing safeguards. At the time of the disclosure, no CVE reference had been assigned to this vulnerability. Microsoft responded to the situation on June 3 with a service-side mitigation, adding confirmation prompts when opening notebooks in the web version and blocking the bypass of the publisher verification. The company believes that no action is required from users.

A Troubling Context: 3,700 Internal GitHub Repositories Exfiltrated Three Weeks Prior

This revelation comes amid heightened scrutiny over developer tools. On May 18, a compromised version of Nx Console—one of the most widely used extensions within the Visual Studio Code ecosystem—was unintentionally published on the official marketplace and the OpenVSX registry for periods ranging from 17 to 36 minutes. Instances with automatic updates enabled harvested the malicious code during that window. GitHub confirmed that this incident resulted in the exfiltration of approximately 3,700 internal repositories belonging to the company.

This campaign, cataloged as CVE-2026-48027 with a severity score of 9.3, underscores the reality that software supply chain security now extends into developer tooling. Code editors, their extension marketplaces, and web-based counterparts hold extensive privileges over repositories, secrets, and authentication tokens, utilizing distribution mechanisms that attackers have learned to exploit. The year has seen similar assaults targeting extension registries and package managers, including tainted npm packages and worms spreading from repository to repository.

What Security Teams Can Do

The mitigation deployed by Microsoft successfully narrows the disclosed exploitation path without altering the design of the globally-scoped token transmitted to github.dev at this time. However, the assertion that no customer action is required is somewhat misleading. A stolen token prior to June 3 remains valid unless revoked. Security teams are encouraged to audit OAuth permissions assigned to GitHub accounts, revoke suspicious sessions, and monitor access logs for unusual enumerations of private repositories.

Moreover, usage of github.dev largely evades IT oversight, as the web editor is enabled by default for all GitHub account holders and operates outside managed devices. Identifying real usage patterns, limiting installable extensions to an approved list, disabling automatic updates for critical extensions, and purging cached data from github.dev in developers’ browsers can reduce exposure. The one-hour gap between notification and the publication of the exploit code serves as a stark reminder that defenders can no longer count on a coordinated reporting grace period.

The rise of autonomous coding agents capable of installing extensions and manipulating repositories without human intervention will further broaden the landscape for such attacks in the coming months. The principle of least privilege, which advocates limiting the scope of authentication tokens to only what is necessary, has regained prominence on security roadmaps.

Scroll to Top