{"id":1141,"date":"2026-06-03T13:56:50","date_gmt":"2026-06-03T13:56:50","guid":{"rendered":"https:\/\/thedigitalfortress.us\/?p=1141"},"modified":"2026-06-03T13:56:50","modified_gmt":"2026-06-03T13:56:50","slug":"one-click-github-dev-attack-lets-attackers-steal-full-github-oauth-tokens","status":"publish","type":"post","link":"https:\/\/thedigitalfortress.us\/?p=1141","title":{"rendered":"One-Click GitHub Dev Attack Lets Attackers Steal Full GitHub OAuth Tokens"},"content":{"rendered":"<div>\n<p><span class=\"p-author\"><i class=\"icon-font icon-user\">\ue804<\/i><span class=\"author\">Ravie Lakshmanan<\/span><i class=\"icon-font icon-calendar\">\ue802<\/i><span class=\"author\">Jun 03, 2026<\/span><\/span><span class=\"p-tags\">Vulnerability \/ Software Development<\/span><\/p>\n<\/div>\n<div id=\"articlebody\">\n<div class=\"separator\" style=\"clear: both;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgeHvqmNHvAhdxgoBLbfFWsFBMdvH5SbJovunxx8AYHRkq7HOQ2l6I_ZaJGi_PF5WHKOlHEQHK4HyPBhmzOpYNhPS4HJSna2uLVlEwUV9i2j5YuRqGOLUqgKIrhx2ndFm1OSME7usiLk_ohtIBYyR5Xpq5Pzc2eHAjCK0OA_89JwPNxVrrBVDbTDRVbRG6e\/s1700-e365\/github.jpg\" style=\"display: block;  text-align: center; clear: left; float: left;\"><\/a><\/div>\n<p>Cybersecurity researchers have disclosed a one-click attack via Microsoft Visual Studio Code (VS Code) that makes it possible to steal a user&#8217;s GitHub token.<\/p>\n<p>\u00abJust by clicking a link, it&#8217;s possible for an attacker to steal a GitHub token that can read and write to your repos, including private ones,\u00bb security researcher Ammar Askar <a href=\"https:\/\/blog.ammaraskar.com\/github-token-stealing\/\">said<\/a>.<\/p>\n<p>GitHub supports a feature called <a href=\"https:\/\/github.com\/github\/dev\">GitHub.dev<\/a> that runs as a <a href=\"https:\/\/docs.github.com\/en\/codespaces\/the-githubdev-web-based-editor\">lightweight web-based source code editor<\/a> in the web browser&#8217;s sandbox by launching a VS Code environment. It allows users to send pull requests and make commits.<\/p>\n<div class=\"dog_two clear\">\n<div class=\"cf\"><a href=\"https:\/\/thehackernews.uk\/ai-cant-stop-d\" rel=\"nofollow noopener sponsored\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"lazyload\" alt=\"Cybersecurity\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjPEV6-530TOlxG6PjrmdlY623wpBwduZ7t1HV6flcmO5R4q4AmfixDUzW0CrhlvMVNWbhvOIso-UDNTka4W_W9Chrdj_dglwBZwi7DuePM2IMIl-hfUYVIqBXgfpr_2619K8Gptb4LzwJ6gUbi7lWl2M8AFQJsHEaw63Q7tZ6708YGruiHrr0Y2W9YYxLQ\/s728-e100\/ThreatLocker-d.png\" width=\"729\" height=\"91\"\/><\/a><\/div>\n<\/div>\n<p>\u00abThis functionality is achieved by github.com POSTing over an OAuth token to github.dev that allows it to interact with GitHub on your behalf,\u00bb Askar said. \u00abThe token is not scoped to the particular repo you interacted with, meaning it has full access to every other repo that you have access to.\u00bb<\/p>\n<p>In a nutshell, the vulnerability allows attackers to install malicious VS Code extensions that steal GitHub OAuth tokens when they are passed to GitHub.dev by exploiting a <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Window\/postMessage\">message-passing mechanism<\/a> between the main VS Code window and <a href=\"https:\/\/code.visualstudio.com\/api\/extension-guides\/webview\">webviews<\/a>. Webviews are used to render Markdown previews or edit Jupyter notebooks.<\/p>\n<div class=\"separator\" style=\"clear: both;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgvwh3V2izKKwTcZio2TXCLwYguXnmEBARQ2F9lsZOTAXj6qdB71X__WJOL8BsZvx05qEMO6J7Fuvfn35rGIy6akT9V32tgLRBdT9kBCoNljwIRVk0TjNFvn5EqjQFiWSGwJs-Jubttfxnwfd2k5MqmGpzNFq0ahugsB7WjMv4gFpqdRvSXHKEFyPJFtwU1\/s1700-e365\/git.png\" style=\"clear: left; display: block; float: left;  text-align: center;\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgvwh3V2izKKwTcZio2TXCLwYguXnmEBARQ2F9lsZOTAXj6qdB71X__WJOL8BsZvx05qEMO6J7Fuvfn35rGIy6akT9V32tgLRBdT9kBCoNljwIRVk0TjNFvn5EqjQFiWSGwJs-Jubttfxnwfd2k5MqmGpzNFq0ahugsB7WjMv4gFpqdRvSXHKEFyPJFtwU1\/s1700-e365\/git.png\" alt=\"\" border=\"0\" data-original-height=\"726\" data-original-width=\"1236\"\/><\/a><\/div>\n<p>Specifically, the exploit runs malicious JavaScript inside an untrusted webview to simulate keypresses (aka keydown events) in the main editor window, open the Command Palette by triggering \u00abCtrl+Shift+P,\u00bb and install an attacker-controlled extension that extracts the GitHub OAuth token sent to GitHub.dev and queries the GitHub API to enumerate all private repositories the victim can access.<\/p>\n<p>It&#8217;s worth noting the approach also leverages a VS Code feature called <a href=\"https:\/\/code.visualstudio.com\/updates\/v1_89#_local-workspace-extensions\">local workspace extensions<\/a> that allows an extension to be directly installed without presenting any additional <a href=\"https:\/\/code.visualstudio.com\/docs\/configure\/extensions\/extension-runtime-security#_extension-publisher-trust\">trust dialog prompt<\/a> as long as it&#8217;s placed in the \u00ab.vscode\/extensions\u00bb folder within that workspace, effectively bypassing the publisher trust check.<\/p>\n<div class=\"dog_two clear\">\n<div class=\"cf\"><a href=\"https:\/\/thehackernews.uk\/vpn-threat-report-m\" rel=\"nofollow noopener sponsored\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"lazyload\" alt=\"Cybersecurity\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhFlTC7RrRZGiFAgASS0noWSL0qsQGFVp8-Hvuw9yp3X3VKRuTcb5SsPX09wJzrdIM6pu1_5lS4EeZp7Sx4iYBpNJkrGnpr08yyaS1HQ5_5TxaCsP6O0OtHNuOkesn6CbNjao1GPulCJk-uljYMSfMZfBYNrngpe669t7jlRn1FqiEnXhsFD1WVkpaYIVgh\/s728-e100\/ai-d.jpg\" width=\"729\" height=\"91\"\/><\/a><\/div>\n<\/div>\n<p>\u00abThis is just a small hiccup though, one of the things that extensions can do as part of their package.json is to contribute extra keybindings to VS Code,\u00bb the researcher explained. \u00abSince we can reliably trigger keybindings, we can just add a keybind for whatever VS Code command we want, such as installing an extension while skipping the trusted publisher check.\u00bb<\/p>\n<p>The researcher also noted GitHub was <a href=\"https:\/\/github.com\/microsoft\/vscode\/issues\/319593\">notified<\/a> of the vulnerability on June 2, 2026, an hour after which details of the issue were made public knowledge, citing Microsoft&#8217;s <a href=\"https:\/\/blog.ammaraskar.com\/vscode-rce\/\">handling<\/a> of <a href=\"https:\/\/starlabs.sg\/blog\/2025\/05-breaking-out-of-restricted-mode-xss-to-rce-in-visual-studio-code\/\">VS Code-related bugs<\/a> in the past. As of writing, Microsoft has acknowledged the vulnerability and noted that it&#8217;s working on a fix.<\/p>\n<p>\u00abTo clarify, this issue does not affect VS Code Desktop,\u00bb Alexandru Dima, a partner software engineering manager at Microsoft, said.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\ue804Ravie Lakshmanan\ue802Jun 03, 2026Vulnerability \/ Software Development Cybersecurity researchers have disclosed a one-click attack via Microsoft Visual Studio Code (VS Code) that makes it possible to steal a user&#8217;s GitHub&hellip;<\/p>\n","protected":false},"author":1,"featured_media":1142,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[220,622,1886,753,71,332,381,1885,571,146],"class_list":["post-1141","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-attack","tag-attackers","tag-dev","tag-full","tag-github","tag-lets","tag-oauth","tag-oneclick","tag-steal","tag-tokens"],"_links":{"self":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts\/1141","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1141"}],"version-history":[{"count":0,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts\/1141\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/media\/1142"}],"wp:attachment":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}