Live data from Hacker News

1-Click GitHub Token Stealing via a VSCode Bug

blog.ammaraskar.com

71–80 of 116 posts

Re: 1-Click GitHub Token Stealing via a VSCode Bug

#72
post #3

This is a very good writeup. Zooming way out (perhaps to the point of useless observation), it's a pity that the web embedded VSCode editor is signed into GitHub at all . Defense-in-depth or not, a huge vulnerability surface arises from that original sin. It'd be like if you had a god-permissioned GitHub API token stored in world-readable plaintext on your workstation for the malicious-NPM-package-of-the-week to find…

I think the problem lies in the fundamental design of VS Code extensions in general. They are essentially Node.js apps with full access to built-in modules, including fs. If the corresponding VS Code instance is launched with your user privileges, extensions can technically read files in ~/.ssh.

It is not safe in the sense that for every extension you install, you are essentially installing a new Node.js app with all its bundled dependencies. Even if you trust the publisher, I am sure there are many holes to exploit.

Re: 1-Click GitHub Token Stealing via a VSCode Bug

#74
post #3

This is a very good writeup. Zooming way out (perhaps to the point of useless observation), it's a pity that the web embedded VSCode editor is signed into GitHub at all . Defense-in-depth or not, a huge vulnerability surface arises from that original sin. It'd be like if you had a god-permissioned GitHub API token stored in world-readable plaintext on your workstation for the malicious-NPM-package-of-the-week to find…

You can use SSH keys and GitHub deploy keys to approximate this. Can't speak for the security of it, but I have never set up GitHub with access to every repo. Not sure if there exists approximate functionality in other git forges though.

How does this work with the in-browser editor at github.dev?

Re: 1-Click GitHub Token Stealing via a VSCode Bug

#76
post #47
post #43

Kudos for the public disclosure. Too many people haven't been happy with MSRC and it's starting to boil over (see the Nightmare Eclipse situation, too). Maybe all of these disclosures will cause them to do some introspection and realize they're the problem. I highly doubt that, but one can dream.

I am not sure if this is still the best approach. They did not even try to submit based on expected "low" ranking when comparing to existing XSS submission. They should at least try or let them know many days before disclosing. You never know.

Its not just one issue they mishandled. It is a pattern. I think this makes sense if you believe long-term security requires leadership change at MSRC.

https://doublepulsar.com/microsofts-stance-on-zero-day-explo...

Re: 1-Click GitHub Token Stealing via a VSCode Bug

#77

I don’t really understand why more devs don’t try Neovim. Maybe it’s just my preference, but I like having a small setup where I know what is installed and what is running. With VSCode, browser IDEs, extensions, sync, tokens, and random plugins, it gets hard to tell what actually has access to what.

I stopped using VS Code and switched to Neovim some years ago, once I noticed that the former would automatically install random Python packages with typings for libraries without stock typings. The “feature” (part of Microsoft’s official Python extension, which was the only one that worked acceptably well for me in other regards) ended up installing type definitions for a different version of a library than the one…

Emacs with vim bindings (evil mode) is also pretty great, and about as stable as it gets. I’ve been all-in for I think 6 or 7 years now. I just the other day installed a little package for tyographic quotes that hadn’t been updated in 16 years (!!), and it worked great.

Depending on what third party packages you use, you may sometimes get breakage there, but if you start out with a kit like doom emacs, you’ll be largely insulated from that.

There’s also always newer stuff like zed, which looks pretty great and is very snappy in my limited testing.

Re: 1-Click GitHub Token Stealing via a VSCode Bug

#78

If you like VSCode but don't like Microsoft, try Zed (zed.dev).

Zed is nice, but the project wide search (sidebar based) in VS Code and diff viewer in VS Code are still better IMO and unfortunately since I no longer code, those are my most used features of an editor. Still using it instead of VS Code but I sure wish it improved those views.

I've been using Zed for a few weeks now and these two are also my main complaints as well.

Re: 1-Click GitHub Token Stealing via a VSCode Bug

#79
post #72
post #3

This is a very good writeup. Zooming way out (perhaps to the point of useless observation), it's a pity that the web embedded VSCode editor is signed into GitHub at all . Defense-in-depth or not, a huge vulnerability surface arises from that original sin. It'd be like if you had a god-permissioned GitHub API token stored in world-readable plaintext on your workstation for the malicious-NPM-package-of-the-week to find…

I think the problem lies in the fundamental design of VS Code extensions in general. They are essentially Node.js apps with full access to built-in modules, including fs. If the corresponding VS Code instance is launched with your user privileges, extensions can technically read files in ~/.ssh. It is not safe in the sense that for every extension you install, you are essentially installing a new Node.js app with all…

[flagged]

Re: 1-Click GitHub Token Stealing via a VSCode Bug

#80
post #54
post #3

This is a very good writeup. Zooming way out (perhaps to the point of useless observation), it's a pity that the web embedded VSCode editor is signed into GitHub at all . Defense-in-depth or not, a huge vulnerability surface arises from that original sin. It'd be like if you had a god-permissioned GitHub API token stored in world-readable plaintext on your workstation for the malicious-NPM-package-of-the-week to find…

> malicious-NPM-package-of-the-week This is going to get worse and worse. I recently noticed AI harness (e.g. OpenCode) downloading random npm packages in the background and litter them everywhere in a few place in ~ and in your project dir, all without telling/asking you. What's worse is that people don't seem to care even the devs.

You typically don't want to run opencode outside a sandbox anyway.
Post reply on HN