Live data from Hacker News

1-Click GitHub Token Stealing via a VSCode Bug

blog.ammaraskar.com

111–116 of 116 posts

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

#111
post #23
post #7

Earlier quoted context omitted.

If the malicious-npm-package-of-the-week is reading arbitrary files on your workstation, isn't it usually able to run git clone/push/whatever with your current credentials anyway?

Not if they're touch required in a secure enclave like a yubikey

Malware running on your computer can engineer a situation where you would naturally press that without suspecting anything.

1. Malware logs you out of github.com

2. It waits for you to navigate to the login page

3. It initiates an SSH/signing operation requiring physical touch

4. You hit login on github.com, a 2nd FIDO operation is queued up

5. You press the yubikey button, confirming the SSH operation

6. "Nothing happens", so you press it again to log in

7. You're now logged in, and your SSH credentials have just been hijacked.

Or it could just inject itself into your shell profile, and do this the next time you ssh anywhere. You never really know what you're confirming so Yubikey's threat model implicitly depends on the host device being trustworthy.

This is why hardware wallets for crypto have a physical display to confirm the address and the amount before signing the transaction.

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

#113
post #84

I am a bit confused. What if I just revoked OAuth access to github.dev? Wouldn't that just make the token unusable?

You cannot, it doesn't go through the regular OAuth flow. GitHub just automatically grants it a token.

Oh, i see thanks for the reply.

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

#114
post #16
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…

> temporary per-repo permission scope or token that allowed only pull and push to the repo in question How about pull from the repo but only push to a staging area from which the user, but not the token, can push for real? Frankly, LLM agents should do this too. Letting your LLM push seems foolhardy to me.

the scope problem is actually worse with agents than with github.dev. the architectural answer is the same though: the credential the agent operates with should be scoped to the task and expire when the task ends.

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

#115
post #95
post #47

Earlier quoted context omitted.

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.

It's not just based on that, if you read the linked report from 2023 ( https://blog.ammaraskar.com/vscode-rce/ ), I had a bug with the exact same impact of token exfiltration (It did need one additional click on the VSCode interface). They marked it as low severity, fixed it silently, didn't acknowledge that it had security impact and did not provide me any credit much less a bounty.

I thought that the general issue was that they ignore the submissions and do not fix them - but the actual problem is that they give different severity and may not give fame or money? I think disclosure for those reasons is highly in gray area from ethical perspective. Regardless if it was clearly in the scope of the bug bounty program or not. That is distinct problem and does not justify public disclosure without warning with enough time.

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

#116

> the last time I interacted with MSRC regarding reporting a VSCode bug, it was a horrible experience where they silently fixed the bug Classic MSRC. It has figured out that researchers will report for free regardless. Why change?

MSRC doesn’t fix bugs. I don’t know the specifics of this case, but I’ve managed bug bounty programs in the past through Bountysource and HackerOne. One thing that occasionally happens is that a report makes its way to the development team before the security team has fully assessed it, in this case MSRC. At that point, a developer may decide to quietly fix the issue. Sometimes that’s driven by a concern, rational or…

This is complete nonsense. Windows releases are supported for 10+ years. Security bugs are patched in all releases that are impacted regardless of whether the issue exists in current branch. A developer fixing an issue has no impact on MSRC being able to reproduce the issue on released builds. The existence of security bugs does not reflect poorly on individual developers, most of whom maintain code they did not write.
Post reply on HN