Threat reportVulnerabilityTL-2026-0667
VSCode Webview 1-Click GitHub OAuth Token Theft — postMessage Keydown-Forwarding Boundary Bypass on github.dev (Full Disclosure, Public PoC)
A critical, unpatched VSCode webview vulnerability lets an attacker steal a victim's unscoped GitHub OAuth token (read/write to ALL private repositories) with a single malicious github.dev link click. VSCode's did-keydown handler forwards untrusted webview keyboard events to the main editor window via Window.postMessage(), allowing attacker JavaScript to synthesize keystrokes, silently sideload a local extension with skipPublisherTrust, read the preloaded OAuth token, and exfiltrate it plus the victim's private-repo list.
Key facts
| Identifiers | TL-2026-0667 |
|---|---|
| Also known as | 1-Click GitHub Token Stealing via VSCode Bug, github.dev OAuth Token Theft |
| Severity | CRITICAL |
| Affected products | GitHub github.dev (browser-hosted VSCode); Microsoft Visual Studio Code (desktop); Microsoft VSCode webview implementation (did-keydown postMessage forwarding) |
| Weaknesses (CWE) | CWE-940, CWE-346, CWE-501, CWE-829, CWE-272 |
| Tools | AmmarTest.hello-ammar-github |
| MITRE ATT&CK techniques | T1059 Command and Scripting Interpreter, T1071 Application Layer Protocol, T1176 Software Extensions, T1189 Drive-by Compromise, T1203 Exploitation for Client Execution, T1204 User Execution, T1213 Data from Information Repositories, T1528 Steal Application Access Token, T1539 Steal Web Session Cookie, T1550 Use Alternate Authentication Material, T1553 Subvert Trust Controls, T1566 Phishing and 1 more in the attack flow |
| Motivation | UNKNOWN |
| Target sectors | technology, software development, open source, financial services, government, healthcare |
| Target regions | Global |
| Detection rules | 9 (1 shown free) |
| Sources | 6 cited sources |
Detection coverage
As of 2026-06-02, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-0667 across Splunk SPL, Microsoft KQL and Sigma, covering 16 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.
Free detection: VSCode github.dev Token Theft — C2/Lateral Movement (Splunk SPL)
Detects the credential-access / C2 / exfiltration stage: the unscoped github.dev OAuth token enumerating all private repositories via api.github.com/user/repos and the token + repo list being exfiltrated by an HTTPS POST to a non-GitHub host.
- Languages: Splunk SPL, Microsoft KQL, Sigma
- ATT&CK: T1528, T1550.001, T1213.003, T1071.001, T1567
- Data sources: proxy, windows_defender_endpoint, network
- Severity: critical
- Confidence: high
Splunk SPL
index=proxy sourcetype="proxy:web" (uri="*api.github.com/user/repos*" OR method=POST)
| eval repo_enum=if(like(uri,"%api.github.com/user/repos%") AND like(cs_referrer,"%github.dev%"),1,0)
| eval token_exfil=if(method=="POST" AND NOT match(dest,"(^|\.)github\.(com|dev|io)$") AND NOT match(dest,"githubusercontent\.com$"),1,0)
| bin _time span=5m
| stats sum(repo_enum) as enum_count sum(token_exfil) as exfil_count values(dest) as dests values(uri) as uris by src_ip, user, _time
| where enum_count>0 AND exfil_count>0
| `comment("TL-2026-0667 C2/EXFIL: the unscoped github.dev OAuth token is used to enumerate ALL private repos via api.github.com/user/repos (github.dev referer), then the token + repo list are exfiltrated by an HTTPS POST to a non-GitHub host.")`
| table _time src_ip user enum_count exfil_count dests urisMicrosoft KQL
DeviceNetworkEvents
| where Timestamp > ago(24h)
// TL-2026-0667 C2/EXFIL: private-repo enumeration via api.github.com/user/repos followed by outbound token exfil to a non-GitHub host
| where InitiatingProcessFileName in~ ("Code.exe", "code", "node.exe", "chrome.exe", "msedge.exe", "firefox.exe")
| extend RepoEnum = iff(RemoteUrl has "api.github.com/user/repos", 1, 0)
| extend NonGitHubPost = iff(RemoteUrl !has "github.com" and RemoteUrl !has "githubusercontent.com" and RemoteUrl !has "github.dev" and RemotePort == 443, 1, 0)
| summarize EnumHits=sum(RepoEnum), ExfilHits=sum(NonGitHubPost), Urls=make_set(RemoteUrl, 30)
by DeviceName, InitiatingProcessFileName, bin(Timestamp, 5m)
| where EnumHits > 0 and ExfilHits > 0
| project Timestamp, DeviceName, InitiatingProcessFileName, EnumHits, ExfilHits, UrlsSigma
title: github.dev Unscoped OAuth Token — Private-Repo Enumeration and Exfiltration
id: 7d2c1f8a-0a11-4e21-9c01-0667aa000003
status: experimental
description: Detects abuse of the unscoped github.dev OAuth token in TL-2026-0667 — enumeration of all private repositories via api.github.com/user/repos with a github.dev referer, and/or a POST carrying the stolen token to a non-GitHub host. github.dev auto-POSTs a token granting read/write to every repo the victim can reach, with no CSRF protection.
references:
- http://blog.ammaraskar.com/github-token-stealing/
- https://cybersecuritynews.com/1-click-github-token-vulnerability/
author: Threadlinqs Team
date: 2026/06/03
tags:
- attack.credential_access
- attack.t1528
- attack.t1550.001
- attack.collection
- attack.t1213.003
- attack.command_and_control
- attack.t1071.001
- attack.exfiltration
- attack.t1567
logsource:
category: proxy
detection:
selection_enum:
c-uri|contains: 'api.github.com/user/repos'
cs-referer|contains: 'github.dev'
selection_post:
cs-method: 'POST'
filter_github:
c-uri|contains:
- 'github.com'
- 'githubusercontent.com'
- 'github.dev'
condition: selection_enum or (selection_post and not filter_github)
falsepositives:
- Automation legitimately calling api.github.com/user/repos from a github.dev session
- Internal tooling POSTing to non-GitHub hosts unrelated to token theft
level: highKnown false positives:
- Legitimate automation calling api.github.com/user/repos from a github.dev session
- Sanctioned internal tools that POST to non-GitHub hosts unrelated to token theft
Tuning notes: Tune the exfil clause to your egress allow-list (CDN, SaaS) to suppress benign non-GitHub POSTs. For HTTPS where the proxy cannot see the full path, correlate on TLS SNI + a github.dev referer in the preceding flow. Raise severity to critical-immediate when a gho_/ghu_/ghp_ token-shaped string is observed in a POST body to a non-GitHub host.
- VSCode [indicator] Token Theft — Exploitation (Microsoft KQL) · unlock with TL Creds
- VSCode [indicator] Token Theft — Post-Exploitation (Microsoft KQL) · unlock with TL Creds
- VSCode [indicator] Token Theft — C2/Lateral Movement (Microsoft KQL) · unlock with TL Creds
- VSCode [indicator] Token Theft — Exploitation (Sigma) · unlock with TL Creds
- VSCode [indicator] Token Theft — Post-Exploitation (Sigma) · unlock with TL Creds
- VSCode [indicator] Token Theft — C2/Lateral Movement (Sigma) · unlock with TL Creds
- VSCode [indicator] Token Theft — Exploitation (Splunk SPL) · unlock with TL Creds
- VSCode [indicator] Token Theft — Post-Exploitation (Splunk SPL) · unlock with TL Creds
Indicators of compromise
As of 2026-06-02, Threadlinqs Intelligence tracks 16 indicators of compromise for TL-2026-0667.
Sample indicators (3 of 16)
- URL:
hxxps://github[.]com/ammaraskar/github-dev-token-steal-poc - URL:
hxxps://github[.]com/ammaraskar/vscode-github-token-grab-extension - URL:
hxxps://api[.]github[.]com/user/repos
Defanged, TLP:CLEAR. Full set of 16 indicators: unlock with TL Creds.
Technical analysis
Disclosed June 2, 2026 by researcher Ammar Askar with a full public proof-of-concept; the desktop VSCode variant escalates to full RCE via Node.js child_process.
This is a security-boundary bypass in the Visual Studio Code webview architecture, weaponized against GitHub's browser-hosted editor github.dev to achieve one-click theft of a fully-scoped GitHub OAuth token.
ROOT CAUSE — UNTRUSTED WEBVIEW CAN FORGE TRUSTED KEYSTROKES: VSCode renders webview content inside iframes whose origin (vscode-webview://) is deliberately isolated from the main editor origin (vscode-file://). For keyboard shortcuts to work while a webview is focused, VSCode registers a keydown listener inside the webview that forwards every keypress to the host window via a 'did-keydown' postMessage. The host then re-dispatches these as if the user pressed them. There is no check that the keydown originated from genuine user input, so JavaScript executing in an untrusted webview can synthesize arbitrary KeyboardEvent objects and drive the trusted main window — collapsing the boundary between 'Untrusted User Content' and 'Dangerous APIs.'
UNSCOPED OAUTH TOKEN ON github.dev: When a user navigates from github.com to github.dev for any repository, github.com auto-POSTs an OAuth token into the github.dev session. Critically, this token is NOT scoped to the repo the user opened — it grants full read/write access to every repository the user can reach. github.dev implements no CSRF protection, so any link anywhere on the internet can silently redirect a victim into a github.dev workspace under attacker control.
EXPLOIT CHAIN (executes in well under a minute, zero interaction beyond the initial click): 1. INITIAL ACCESS / EXECUTION — The victim clicks a link to an attacker-controlled github.dev repo opening a malicious Jupyter notebook (README.ipynb). A notebook cell contains <img src="data:foobar" onerror="..."> whose onerror handler runs attacker JavaScript inside the webview. 2. NOTIFICATION ACCEPT — The script dispatches a synthetic Ctrl+Shift+A keydown ('Notifications: Accept Notification Primary Action'), accepting the 'install recommended extensions' prompt produced by an attacker-supplied .vscode/extensions.json. 3. PUBLISHER-TRUST BYPASS — Rather than a Marketplace extension (which since VSCode 1.89 requires publisher trust), the attacker ships a LOCAL workspace extension placed directly in .vscode/extensions/. github.dev workspaces are always trusted, so the local extension loads. Its package.json contributes a keybinding (Ctrl+F1 -> runCommands -> workbench.extensions.installExtension) that installs the real payload extension with context skipPublisherTrust:true, fully bypassing the publisher-trust dialog. 4. KEYBINDING TRIGGER — The script dispatches a synthetic Ctrl+F1 keydown to fire that keybinding. 5. TOKEN THEFT & EXFIL — The installed extension runs with full VSCode API access, reads the preloaded GitHub OAuth token, enumerates every private repository via https://api.github.com/user/repos, and exfiltrates the token plus the private-repo list to the attacker.
DESKTOP IMPACT — RCE: The same webview keydown-forwarding flaw exists in desktop VSCode. Exploitation is harder (the victim must clone/open the attacker's repository and open the notebook), but a loaded extension has unrestricted Node.js APIs including child_process, escalating to full remote code execution on the developer workstation.
DEFENSE-IN-DEPTH THAT DID NOT STOP IT: VSCode applies a strict CSP (script-src 'none') on extension Markdown/preview pages and uses DOMPurify to sanitize rendered HTML, which blocked simpler injection vectors — but neither prevents an untrusted webview from synthesizing keyboard events to drive the host.
DISCLOSURE: Researcher Ammar Askar published a full public disclosure on June 2, 2026, including working PoC repositories, after citing prior negative experiences with Microsoft's MSRC (silent fixes without credit, incorrect severity assessments). GitHub Security was notified roughly one hour before public posting; the corresponding microsoft/vscode issue #319593 was filed the same day. No vendor patch existed from Microsoft or GitHub at the time of disclosure. No CVE had been assigned by the source at disclosure.
MITRE ATT&CK techniques by tactic:
Execution
T1059 Command and Scripting Interpreter; T1203 Exploitation for Client Execution; T1204 User Execution
Command and Control
T1071 Application Layer Protocol
Persistence
Initial Access
T1189 Drive-by Compromise; T1566 Phishing
Collection
T1213 Data from Information Repositories
Credential Access
T1528 Steal Application Access Token; T1539 Steal Web Session Cookie
lateral-movement
T1550 Use Alternate Authentication Material
defense-impairment
Exfiltration
Remediation
Patches
- No vendor patch available from Microsoft or GitHub at time of disclosure (June 2, 2026). Track microsoft/vscode issue #319593 for the fix.
Immediate actions
- Clear github.dev site data in the browser (Chrome: URL-bar site-info icon -> Cookies and site data -> Delete domain data) to purge the cached OAuth token and re-enable the first-visit consent dialog.
- Avoid clicking unknown or untrusted github.dev links until Microsoft/GitHub ship a patch.
- Audit installed github.dev extensions and uninstall anything unrecognized or recently auto-installed.
- Consider blocking github.dev at the web proxy/DNS layer organization-wide until patched.
Workarounds
- Clearing github.dev local/site storage restores the initial sign-in consent dialog, providing a brief intervention point.
- Disable or block github.dev usage across the organization until a fix ships.
- For desktop VSCode, do not clone/open untrusted repositories or notebooks; keep Workspace Trust enabled.
Longer-term hardening
- Treat any exposed token as fully compromised: revoke GitHub OAuth authorizations/sessions and rotate affected credentials and PATs.
- Monitor GitHub audit logs for anomalous https://api.github.com/user/repos enumeration and unexpected pushes/clones across private repos.
- Enforce least-privilege, repo-scoped tokens; press GitHub to scope the github.dev token to the opened repository only.
- Deploy enterprise browser policies and EDR to detect malicious VSCode/IDE extension installation and child_process abuse on developer endpoints.
Affected and fixed versions
- GitHub — github.dev (browser-hosted VSCode)
Vulnerable versions: live service as of 2026-06-02
Fixed in: none at disclosure - Microsoft — Visual Studio Code (desktop)
Vulnerable versions: 1.89+ (publisher-trust era; webview did-keydown forwarding present)
Fixed in: none at disclosure - Microsoft — VSCode webview implementation (did-keydown postMessage forwarding)
Vulnerable versions: all builds with did-keydown host forwarding
Fixed in: none at disclosure
Timeline
- Ammar Askar identifies that VSCode's did-keydown handler forwards untrusted webview keyboard events to the main window and that github.dev issues an unscoped OAuth token, enabling a 1-click token-theft chain (research predates public disclosure).
- No patch available from Microsoft or GitHub at time of disclosure; github.dev remains exploitable and no CVE assigned by the source.
- microsoft/vscode issue #319593 filed regarding the webview keydown-forwarding security boundary.
- Public proof-of-concept repositories released: github-dev-token-steal-poc (malicious locked-ioc-7 notebook) and vscode-github-token-grab-extension (token-grabbing extension).
- Full public disclosure published on Ammar Askar's blog with complete technical write-up and step-by-step exploit chain.
- GitHub Security notified approximately one hour before public disclosure; no coordinated disclosure with Microsoft MSRC due to prior negative experiences.
- Cyber Security News publishes coverage detailing the 1-click GitHub OAuth token theft and desktop RCE escalation.
Sources cited
- 1-Click GitHub Token Stealing via a VSCode Bug — Ammar's Blog (primary research, PoC) blog.ammaraskar.com · Research · 2026-06-02
- Cybersecurity spotlight on bug bounty researcher Ammar Askar — The GitHub Blog github.blog · Vendor report · 2026-06-02
- PoC repository — github-dev-token-steal-poc (malicious notebook payload) GitHub · Proof of concept · 2026-06-02
- PoC repository — vscode-github-token-grab-extension (malicious extension) GitHub · Proof of concept · 2026-06-02
- microsoft/vscode issue #319593 — webview keydown forwarding security boundary GitHub · Code repository · 2026-06-02
- 1-Click GitHub Token Vulnerability Lets Attackers Steal Users' OAuth Tokens cybersecuritynews.com · News · 2026-06-03
Previous and next in vulnerability
- WordPress Kirki Plugin CVE-2026-8206 — Unauthenticated Account Takeover via Password-Reset Email Hijack (Active Exploitation, ~500K Sites) Previous report
- HTTP/2 Bomb — Remote DoS via HPACK Indexed-Reference Compression Bomb + Zero-Window Flow-Control Hold Affecting nginx, Apache httpd, IIS, Envoy & Cloudflare Pingora (CVE-2026-49975, Public PoC) Next report
Drafted by the Threadlinqs research pipeline from 6 sources; published ; last updated —.