Skip to content
RCE Write-up Intermediate

Using URI to pop shells via the Discord Client

The Discord client rendered URI schemes wrapped in angle brackets as clickable links and would launch the associated local application without a prompt. An attacker could send a crafted ms-word URI that opened a remote Word document with a VBA macro, which then downloaded and ran a reverse shell on the victim's Windows machine.

RagSec Follow

Published on 0x00sec.org

Exploit Development

RagSec (@rag_sec), on 0x00sec.org

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

Root cause

Likely the Discord client did not validate or restrict which URI schemes it would turn into clickable links, so any registered scheme on the host could be launched.

Impact

An attacker could cause the victim's machine to launch local applications and, via a Word macro, execute a reverse shell, though the researchers only got this working on Windows 10 and Discord argued it was intended behaviour and social engineering rather than a vulnerability.

What the attacker needed

Discord client on Windows 10; victim clicks the crafted link; attacker hosts payload and document; victim has Microsoft Word installed

The fix

Discord should validate URI schemes and allow only those that make sense for a typical user, such as HTTP and HTTPS; the text says Discord was elevating the issue internally but does not confirm a fix.

How it was found

  1. Generate a PowerShell reverse shell payload with the Social-Engineer Toolkit.
  2. Upload the payload to a web location.
  3. Create a Word document with a VBA macro that fetches and runs the payload.
  4. Upload the Word document to the same web location.
  5. Start a listener on the chosen port.
  6. Send the victim a crafted ms-word URI that opens the remote document.

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.

A URI scheme is the part before '://' in a link, like 'http' or 'mailto', and it tells the computer which program should open the link. Discord treated any scheme in angle brackets as a clickable link and started the matching program without asking the user. The researchers abused the Word scheme to open a document from the internet that contained a macro, a small script inside the file, which then ran a reverse shell, a program that lets the attacker control the machine.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More from Discord

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.