On December 18, 2024, security researchers disclosed a vulnerability in Microsoft Visual Studio Code that allowed attackers to steal GitHub OAuth tokens with a single user click. This attack exploited VS Code's extension system and GitHub's OAuth implementation, granting attackers full access to victims' private repositories without needing credentials.
Microsoft acknowledged the vulnerability and stated it had been mitigated. However, this incident highlights fundamental weaknesses in how development tools handle authentication tokens and the ease with which social engineering can bypass technical controls.
What Happened
Attackers created malicious VS Code extensions that, when installed and activated with one click, could extract GitHub OAuth tokens stored by the editor. These tokens provide the same level of access as the user's GitHub credentials, including read and write permissions to private repositories.
The attack required minimal user interaction: install a seemingly legitimate extension, click to activate it, and the token exfiltration occurred silently. No password prompts or additional authentication were needed—just one click.
Once stolen, these OAuth tokens gave attackers persistent access to repositories until the tokens were manually revoked or expired. The attacker could clone private code, modify files, or use the access as a foothold for supply chain attacks.
Timeline
Pre-December 18, 2024: The vulnerability existed in VS Code's extension architecture and GitHub OAuth token handling. It is unknown how long the attack vector was exploitable or if it was used in the wild before disclosure.
December 18, 2024: Security researchers publicly disclosed the vulnerability, detailing the one-click attack mechanism.
Post-disclosure: Microsoft acknowledged the issue and stated mitigation was in place. The exact remediation timeline and whether it required VS Code updates or GitHub OAuth changes remains unclear.
Which Controls Failed
Extension vetting failed. VS Code's extension marketplace did not prevent malicious extensions from accessing stored OAuth tokens. The extension permission model allowed broad access to authentication credentials without sufficient user awareness or granular consent.
Token storage security failed. OAuth tokens were stored in a location and format that extensions could access. Extensions that had no legitimate need for GitHub authentication could still reach these credentials.
User awareness controls failed. The installation and activation flow did not clearly communicate that an extension would gain access to GitHub credentials. Users made a single click without understanding the security implications.
Token scoping failed. The OAuth tokens provided full repository access rather than scoped permissions. Once stolen, the token granted the same broad access as the user's primary credentials.
Anomaly detection failed. Neither VS Code nor GitHub detected unusual token access patterns or flagged suspicious extension behavior during the attack.
What Standards Require
ISO/IEC 27001:2022 Annex A.9.4.3 (Privileged access management) requires organizations to restrict and control privileged access rights. OAuth tokens with full repository access are privileged credentials and must be protected with controls equivalent to administrative passwords.
Your implementation: Treat OAuth tokens as privileged credentials. Store them encrypted at rest, restrict which processes can access them, and log all token access events. If your team uses VS Code, audit which extensions have filesystem access and revoke permissions for any extension that doesn't need it.
NIST 800-53 Rev 5 Control IA-5 (Authenticator Management) requires organizations to protect authenticators against unauthorized disclosure and modification. OAuth tokens are authenticators—they prove identity and grant access.
Your implementation: Implement token rotation policies. GitHub OAuth tokens should expire and require re-authentication at defined intervals. For high-risk environments, set token lifetimes to 24 hours or less. Configure your OAuth applications to request minimal scopes—if an extension only needs read access to public repos, don't grant it write access to private ones.
OWASP ASVS v4.0.3 Requirement 2.10.4 states: "Verify that OAuth and refresh tokens are stored securely." Storing tokens in plaintext or in locations accessible to arbitrary applications violates this requirement.
Your implementation: If you're building tooling that stores OAuth tokens, encrypt them using your operating system's credential manager (Windows Credential Manager, macOS Keychain, Linux Secret Service). Never store tokens in configuration files, environment variables, or browser local storage where extensions can access them.
PCI DSS v4.0.1 Requirement 8.3.2 requires multi-factor authentication for all access to cardholder data environments. While this incident didn't involve payment data, the principle applies: single-factor authentication (an OAuth token) should not grant persistent access to sensitive resources.
Your implementation: Enable GitHub's required 2FA for your organization. This won't prevent token theft, but it limits the damage if credentials are compromised through other vectors. For VS Code specifically, require re-authentication when extensions request sensitive permissions.
SOC 2 Type II CC6.1 (Logical and Physical Access Controls) requires entities to implement logical access security measures to protect against threats from sources outside its system boundaries. A malicious extension is an external threat that crossed your system boundary.
Your implementation: Maintain an approved extension allowlist. Use VS Code's extensions.json in your workspace settings to specify exactly which extensions your team can install. Block installation of extensions not on the list. Review the allowlist quarterly and remove extensions that haven't been updated in six months.
Lessons and Action Items
Audit your installed extensions today. Open VS Code, go to the Extensions panel, and review every installed extension. Remove any you don't actively use. For the remaining extensions, verify:
- When was it last updated?
- How many installations does it have?
- Who publishes it?
- What permissions does it request?
Extensions with fewer than 1,000 installations or no updates in the past year should be removed unless you have a specific business need.
Rotate your GitHub tokens now. Go to GitHub Settings → Applications → Authorized OAuth Apps and revoke access for VS Code. Then re-authenticate. This invalidates any stolen tokens. Do this even if you don't think you were compromised—it's a zero-cost control.
Implement token scoping. When you re-authenticate VS Code with GitHub, review the requested scopes. If VS Code asks for repo (full repository access), question whether you need it. For most development work, repo:status and public_repo are sufficient.
Enable GitHub audit logs. If you're on GitHub Enterprise or Teams, enable audit log streaming to your SIEM. Configure alerts for:
- OAuth token creation from new applications
- Repository access from unusual IP addresses
- Bulk repository cloning
- Changes to repository settings
Build an extension review process. Before any developer installs a new VS Code extension:
- Search for the extension name plus "vulnerability" or "security"
- Check the extension's repository for recent commits and issue activity
- Review the extension's
package.jsonto see what Node modules it depends on - Install it in an isolated environment first and monitor its network traffic
Document your OAuth application inventory. List every OAuth application that has access to your GitHub organization. For each application, document:
- What it does
- Who requested it
- What scopes it has
- When it was last reviewed
Review this inventory monthly. Revoke access for applications no one remembers requesting.
Train your developers on OAuth security. Most developers don't understand that OAuth tokens are equivalent to passwords. Run a 15-minute session explaining:
- What OAuth tokens are
- Where they're stored
- What access they grant
- How to recognize token theft
The VS Code vulnerability was mitigated, but the pattern will repeat. Extensions, plugins, and integrations will continue to be vectors for token theft. Your defense is not waiting for vendors to fix every vulnerability—it's reducing your attack surface, limiting token scope, and detecting misuse quickly.



