# Open Redirect on slack.com

Binary-prefixed HTML uploaded as a file bypassed Slack's sanitization, and slack.com/files-pri links rendered it, enabling open redirect and phishing.

- Payout: $500
- Severity: medium
- Program: Slack
- Credited: sudotop
- Disclosed: 2016-10-02
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/140447
- Library page: https://bugbountylibrary.com/r/h1%3A140447
- Tags: domain:web impact:ato kind:bounty platform:hackerone sev:medium technique:chained technique:parser-differential vuln:file-upload vuln:open-redirect vuln:xss

**Target:** Slack file upload and file-sharing link (files.slack.com / slack.com/files-pri)
**Root cause:** Slack's file sanitization on slack-files.com could be bypassed by prepending binary characters before HTML content, causing the file to be served/rendered as HTML rather than downloaded; combined with slack.com/files-pri path that proxies to the file, the attacker-controlled HTML executes in the slack.com origin context.
**Steps:**
1. Upload a file via `POST /api/files.uploadAsync` with `filename="pixel.png"`, `Content-Type: text/html`, and body containing binary chars followed by `<html><script>window.location='http://www.evil.com';</script></html>`
2. Create a public link for the uploaded file to get `https://files.slack.com/files-pri/T1ARLSGBS-F1AU0FTGR/pixel?pub_secret=...`
3. Alternatively use `https://slack.com/files-pri/T1ARLSGBS-F1AU0FTGR/pixel?pub_secret=...` directly
4. Send victim the link; the HTML renders and redirects to attacker domain, or a phishing login page hosted at `https://slack.com/files-pri/.../login?pub_secret=...` captures credentials
**How found:** Researcher built on prior report #104087 (SVG XSS) and hypothesized that prepending binary characters to HTML would defeat the sanitizer that otherwise forces download, then tested via files.uploadAsync and the files-pri public link path.
**Exploitation:** Attacker uploads HTML content disguised as an image with binary prefix to bypass sanitization, shares the resulting slack.com/files-pri public link, and the victim's browser renders the attacker HTML in the slack.com origin, enabling open redirect to evil.com or a convincing phishing login page that harvests Slack credentials.
**Escalation:** Chained sanitization bypass with slack.com/files-pri path to host arbitrary HTML/phishing under the trusted slack.com origin; attacker controls file content and name, enabling malware, exploits, or illegal content distribution.
**Insight:** When a file host sanitizes by content-type or extension, try prepending binary/garbage bytes to shift parser detection while keeping HTML renderable; also test alternate host paths (e.g. main domain /files-pri) that proxy the same storage, since sanitization may only apply on the canonical file host.
