Skip to content
Info disclosure Write-up Beginner

Discord Rich Presence LeonardSSH.vscord

The VSCord VS Code extension passed the full Git remote URL, including embedded GitHub credentials, to Discord Rich Presence without stripping them. An attacker viewing the victim's Discord profile could click 'View Repository' and copy the URL from the browser address bar to obtain the victim's GitHub personal access token.

Sudhanshu Rajbhar Follow

Published on github.com

History

Sudhanshu Rajbhar (@sudhanshur705), on github.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

Any Discord user who viewed the victim's profile could obtain the victim's GitHub personal access token, potentially leading to unauthorized access to private repositories and other GitHub resources.

What the attacker needed

VS Code with VSCord extension below 5.1.8; Not signed in to GitHub in VS Code; Clone a private repo using token as password; Victim has Discord Rich Presence enabled

The fix

The extension was fixed by stripping the username and password from the URL before passing it to Discord.

How it was found

  1. Ensure you are not signed in to GitHub in VS Code.
  2. Create a private repository on GitHub.
  3. Clone it in VS Code and enter your GitHub username and personal access token when prompted.
  4. Edit a file in the repository and check Discord.
  5. Click 'View Repository' and then 'Yep' to open the URL in a browser.
  6. Copy the URL from the browser address bar to see the token.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When you clone a private GitHub repository, your username and personal access token (a secret password) can be saved in the repository's configuration file. This extension sent that whole URL to Discord, so anyone who saw your Discord status could click a button and copy the URL, revealing your token. That token could then be used to access your GitHub account.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Sudhanshu Rajbhar

View all

12 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.