HexBrain

Slack · Report #100565

Executing scripts on slack-files.com using SVG

Validstatus
4upvotes
18 Feb 2016disclosed

How it was found

Impact

Although slack-files.com is a sandbox domain, there are many ways to gain the victim's trust during phishing attack. For example, an attacker might render a fake log-in form with "You need to sign in to see this file" message and trick users into handing out their passwords.

Steps to reproduce

  1. Download attached to report or use the following code snippet to create SVG file:
<svg width="100%" height="100%" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" onload="alert('script')">
  <script type="text/javascript"><![CDATA[
  // some exploit code here
  ]]></script>

  <circle cx="50" cy="50" r="50" fill="green" />
</svg>

A SVG script and other DOM elements is equivalent to the elements in HTML, so in the example above alert('script') will be executed on svg load event.

  1. Upload constructed SVG file to some channel or dm in Slack.

  2. Click on message with just uploaded file.

Observed

Clicking on message opens a new tab and navigates user to slack-files.com. Once SVG loaded the alert('script') is executing.

Also this file can be shared via public link. In this case victim should click on image preview to start script execute.

Expected

Users expect that after clicking on message with file they will see this file or file will be downloaded.

Possible fix

There are three ways:

This report was disclosed publicly on HackerOne and belongs to its author and the program. See the original