Skip to content
RCE Disclosed report Intermediate

Code Injection in Slack's Windows Desktop Client leads to Privilege Escalation

Slack's Windows client tried to load an OpenSSL configuration file from a non-existent path at the root of the system drive, which any authenticated user could create. A local attacker could place a malicious config file there to load additional libraries and execute arbitrary code in other users' Slack processes.

fbogner Follow

Originally disclosed on HackerOne

  • Triaged in 8 days
  • Fixed in 10 months
  • Paid in 10 months
  • Disclosed after 11 months

Hi,

This report is about a Code Injection vulnerability in Slack's Windows Desktop Client (slack.exe) that allows any local user to inject code into other user's Slack client.

It has been verified on a fully patched english Windows 7 64bit running the latest available Slack Desktop Client (2.1.1 32-Bit Direct Download).

The issue is that slack.exe tries to load its OpenSSL configuration from the non-existing file C:\usr\local\ssl\openssl.cnf (See Procmon screenshot). As any authenticated Windows user is allowed to create new folders at the system drive's root, the expected folder structure can be created by anyone.

This enables any local user to create the expected OpenSSL config file. Using this config file it is then possible to instruct OpenSSL to load additional libraries. This finally leads to arbitrary code execution in other user's slack.exe process. This is especially a problem as Slack is automatically started after logging in.

Here's a video illustrating the attack: https://owncloud.bogner.sh/s/MRXZSp0YyfK9ycf Additionally you can download the source code and the binary version of the used payloads here: https://owncloud.bogner.sh/s/z7kbZr9STr08R73

To fix this vulnerability the OpenSSL config file should only be loaded from secure locations (like somewhere from within the application's root folder)

If you have any questions just let me know. Florian

Attachments

Screen_Shot_2016-08-24_at_09.48.52.png
Screen_Shot_2016-08-24_at_09.48.52.png From the original on HackerOne

The original report as published on HackerOne, by fbogner. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

How it worked

Root cause

Likely the application loaded an OpenSSL configuration file from a world-writable location at the root of the system drive, allowing any local user to control its contents.

Impact

A local attacker could execute arbitrary code in other users' Slack processes, and because Slack starts automatically after login, the attack could affect other users on the same machine.

What the attacker needed

Local user account on Windows; ability to create folders at system drive root; another user logs in or starts Slack

The fix

The OpenSSL configuration file should be loaded only from a secure location, such as within the application's own folder.

How it was found

  1. Create the missing folder structure at the root of the system drive.
  2. Place a crafted OpenSSL configuration file in that folder that instructs OpenSSL to load additional libraries.
  3. Wait for another user to log in or start Slack, causing Slack to load the malicious configuration and execute the attacker's code.

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 report has not been written yet. The Original tab links to the source.

When a program starts, it sometimes reads settings from a file. Here, Slack looked for a settings file in a folder that did not exist, but any normal user on the computer could create that folder and file. A bad user could then put harmful instructions in that file so that when another user starts Slack, the program runs the attacker's code.

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 fbogner

View all

1 more disclosed report, best first.

More from Slack

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.