Skip to content
RCE Write-up Intermediate

Allow arbitrary URLs, expect arbitrary code execution

Desktop applications that pass user-supplied URLs to the operating system for opening can be tricked into executing malicious files hosted on remote shares. An attacker could achieve code execution with one or two clicks by providing a URL that points to an executable file on a network share.

Fabian Bräunlein Follow

Published on positive.security

In this post, we show code execution vulnerabilities in numerous desktop applications, all with the same root cause: insufficient validation of user input that is later treated as a URL and opened with the help of the operating system. The required user interaction and exploitation strategy depends on the desktop…

Fabian Bräunlein, Lukas Euler, on positive.security

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 applications fail to validate the URI scheme or destination of user-supplied URLs before passing them to OS functions like QDesktopServices::openUrl, which can open remote executable files.

Impact

An attacker could achieve code execution on the victim's machine with one or two clicks, depending on the OS and application; some defences like URI-scheme allowlists or file-extension blacklists may limit or block exploitation.

What the attacker needed

Victim clicks a link; attacker controls a remote file share; vulnerable desktop application

The fix

The applications should validate URLs against an allowlist of safe schemes (e.g., http/https) or display a comprehensive warning before opening non-http(s) links; some vendors have fixed specific issues.

How it was found

  1. Identify a feature in a desktop application that opens user-supplied URLs via the OS.
  2. Craft a URL pointing to an executable file on a remote file share (e.g., sftp, smb, nfs).
  3. Send the URL to the victim (e.g., via a chat message or public server list).
  4. The victim clicks the link, causing the OS to mount the share and open the file.
  5. The executable runs, achieving code execution.

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.

Some programs let you click a link, and they ask the operating system to open it. If the program does not check what kind of link it is, an attacker can give a link that points to a harmful file on a remote server. When the operating system opens that link, it may download and run the file, letting the attacker run their own code on your computer.

What is RCE?

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

More by Fabian Bräunlein

View all

1 more disclosed report, best first.

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.