A single malicious link. One click from a developer. A fully authenticated GitHub token handed to an attacker. That was the reality of a recently disclosed vulnerability in Visual Studio Code — the editor sitting open on millions of engineering workstations right now.

This is not a theoretical supply-chain scare story. It is a precise, reproducible exploit that targeted the trust developers place in their tooling every single day. Understanding how it worked is useful for every team that ships software, not just security researchers.

What VSCode Tokens Actually Are

When you authenticate VSCode with GitHub — to push code, pull private repos, or use GitHub Copilot — the editor stores an OAuth token locally. That token is a fully scoped credential. Depending on how it was issued, it can read private repositories, write code, manage Actions workflows, and interact with the GitHub API on your behalf.

Unlike a password, tokens are rarely rotated. Developers often have them sitting in their keychain for months or years. Stealing one is functionally equivalent to stealing long-term access to a developer's GitHub identity.

The Shape of the Vulnerability

The vulnerability lived in how VSCode handled custom URI schemes — specifically the vscode:// deep-link protocol that allows external applications and web pages to trigger actions inside the editor.

VSCode exposes extension APIs through this mechanism. The flaw arose because certain flows within the GitHub authentication extension did not validate the origin or intent of incoming URI-based requests with sufficient strictness. An attacker could craft a malicious URL that, when opened in a browser on a machine running VSCode, would silently trigger the authentication callback flow and redirect the resulting token to an attacker-controlled endpoint.

The victim does not install anything. They do not approve a suspicious prompt. They click a link — on a webpage, in an email, in a chat message — and the token is gone.

This class of attack is sometimes called a redirect URI hijack or an OAuth callback interception. What made this instance particularly sharp was the attack surface: VSCode is installed on virtually every active development machine, the vscode:// URI scheme is registered at the OS level during installation, and developers are conditioned to click links that open their editor (think "Open in VSCode" buttons everywhere).

Why This Pattern Keeps Appearing

Deep-link URI schemes are a well-known attack vector. Mobile developers have dealt with variants of this for years — malicious apps registering the same custom scheme as a legitimate one, intercepting OAuth callbacks on iOS and Android. The web world contends with it through strict redirect_uri validation on OAuth servers.

Desktop applications have lagged behind. The assumption seems to be that the local machine is a trusted environment, so inbound deep links deserve more trust than they have earned. That assumption is wrong in a world where:

  • Developers routinely open links from GitHub issues, Slack messages, and pull request comments
  • Phishing payloads can be embedded in technically legitimate-looking developer content
  • Editors like VSCode run with full user-level permissions, including keychain and credential access

The attack does not need to be sophisticated. It just needs to find a gap between what the application assumes about an incoming request and what an attacker can actually send.

What a Hardened Extension Auth Flow Looks Like

Secure OAuth flows in desktop and editor contexts should enforce several properties:

1. State parameter validation  — a cryptographic nonce tied to the
   initiating session, verified before the token is accepted.

2. Origin checks               — reject callbacks that did not originate
   from a user-initiated action within the application itself.

3. Short-lived intermediaries  — never store the raw token in a place
   reachable by arbitrary URI handlers; use a short-lived code exchange.

4. Explicit user confirmation  — for any auth action triggered by an
   external URI, surface a visible confirmation dialog before completing
   the flow.

None of these controls are exotic. They are standard OAuth 2.0 security best practices documented in RFC 6749 and its security extensions. The gap is usually implementation discipline, not missing knowledge.

Practical Steps for Development Teams

If your team uses VSCode and GitHub — which is most teams — there are concrete actions worth taking now:

  • Audit your token scopes. GitHub lets you inspect active tokens and their permissions under Settings → Developer Settings. Revoke any token that has broader scope than it needs.
  • Prefer fine-grained personal access tokens. GitHub's newer fine-grained PATs let you restrict a token to specific repositories and specific operations. A stolen fine-grained token does far less damage than a classic one.
  • Enable GitHub's push protection and secret scanning. If a token somehow ends up in a codebase, these controls can catch it before it leaks publicly.
  • Keep VSCode updated. Microsoft patched this class of issue in a subsequent release. Auto-updates are on by default; verify your team's fleet is not pinned to an older version via enterprise policy.
  • Treat deep-link clicks with the same scepticism as executable downloads. Encourage engineers to be suspicious of vscode:// links that arrive unexpectedly, even from familiar-looking sources.

The Bigger Picture for SaaS and Software Products

If you are building an application that integrates with GitHub, Google, or any OAuth provider, this incident is a reminder to audit your own redirect URI handling. Many SaaS products register broad redirect URI patterns — sometimes using wildcards — to make integration easier. That convenience is a liability. Lock your registered redirect URIs to the most specific paths possible, validate state parameters on every callback, and log anomalous auth events so you can detect token abuse early.

For teams building VSCode extensions specifically: you are inheriting a powerful and complex trust model. Read the extension security guidance Microsoft publishes, avoid handling auth tokens directly in extension code where possible, and treat the vscode:// URI handler as a public endpoint — because in practice, it is.

Source: 1-Click GitHub Token Stealing via a VSCode Bug — Ammar Askar / Hacker News


Why this matters for your project: Developer tooling is infrastructure. The credentials your engineers use to ship code are as sensitive as your production secrets, yet they often receive far less protection. Whether you are scaling a SaaS product or managing a growing engineering team, building a culture of credential hygiene — short-lived tokens, minimal scopes, regular audits — is one of the highest-leverage security investments you can make. The cost of a stolen GitHub token is not just a compromised repo; it is potentially your entire deployment pipeline, your customer data integrations, and your intellectual property.