Skip to content
RCE Write-up Intermediate

What is Amazon WorkSpaces

The Amazon WorkSpaces desktop client failed to sanitise parameters in its custom URI scheme, allowing an attacker to inject command-line arguments that led to arbitrary command execution. An attacker could execute commands on the victim's machine if the victim opened a malicious workspaces:// link.

rhinosecuritylabs.com

Published on rhinosecuritylabs.com

This post details a vulnerability Rhino Security Labs discovered in the AWS WorkSpaces desktop client, tracked as CVE-2021-38112, which allows commands to be executed if a victim opens a malicious WorkSpaces URI from their browser. Rhino reported the vulnerability to Amazon and it was promptly patched.

David Yesland, on rhinosecuritylabs.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

Root cause

The WorkSpaces client URL-decoded URI parameters and passed them to a new process command line without sanitising them, enabling argument injection.

Impact

An attacker could execute arbitrary commands on the victim's operating system, and potentially pivot into the WorkSpace or keylog credentials.

What the attacker needed

Victim has WorkSpaces client 3.0.10–3.1.8; Victim opens a malicious workspaces:// link; Attacker has a valid WorkSpaces registration code

The fix

The vulnerability was fixed in version 3.1.9.

How it was found

  1. Set up AWS WorkSpaces and obtain a valid registration code.
  2. Craft a workspaces:// URI containing an injected --gpu-launcher argument with an arbitrary command.
  3. Open the crafted URI in a browser, which launches the WorkSpaces client.
  4. The client URL-decodes the parameters and launches a second process with the injected argument, executing the command.

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 custom URI is a special link that opens a desktop app, like workspaces://. The app took parts of that link and used them to start another process without cleaning them first. This let an attacker sneak in extra instructions that ran their own commands on the computer.

What is RCE?

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

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.