# TURN server allows TCP and UDP proxying to internal network, localhost and meta-data services

Slack's TURN servers relayed TCP/UDP to private IPs via XOR-PEER-ADDRESS, letting attackers reach AWS metadata and internal 10.0.0.0/8 services.

- Payout: $3,500
- Severity: critical
- Program: Slack
- Found by: sandrogauci
- Disclosed: 2020-03-12
- Write-up quality: 8/10
- Original: https://hackerone.com/reports/333419
- Library page: https://bugbountylibrary.com/r/h1%3A333419
- Tags: area:cloud domain:cloud impact:data-leak impact:internal-access kind:bounty platform:hackerone sev:critical tech:aws technique:recon technique:source-review vuln:misconfiguration vuln:ssrf

**Target:** TURN/STUN relay server (Coturn) used by Slack WebRTC
**Root cause:** TURN server did not restrict XOR-PEER-ADDRESS to public addresses, so CONNECT (0x000A) and Send indication (0x0006) messages could target localhost, private ranges, and link-local metadata IPs.
**Steps:**
1. Configure browser through Burp; filter HTTP history for `screenhero`.
2. Start a call; capture `/api/screenhero.rooms.create` response containing temporary TURN username, password, hostname, ports.
3. Feed credentials to stunner; send TURN CONNECT (method `0x000A`) with `XOR-PEER-ADDRESS` set to `169.254.169.254` or `10.x.x.x`.
4. For UDP, send TURN Send indication (method `0x0006`) with `XOR-PEER-ADDRESS` set to private IP.
5. Use `turn peer scanner` to port-scan 10.41.0.0/16 and `turn peer httpproxy` to browse internal HTTP services via the relay.
**How found:** Read the TURN RFCs (6062, 5766) and hypothesized that XOR-PEER-ADDRESS was unvalidated; built stunner subcommands (peer scanner, httpproxy) to test relaying, then applied to Slack after observing TURN is always used for its media.
**Exploitation:** Attacker obtains short-lived TURN credentials from the WebRTC call API, then uses stunner to issue TURN CONNECT/Send messages with private XOR-PEER-ADDRESS values, relaying arbitrary TCP/UDP to AWS metadata (169.254.169.254) for IAM credentials, localhost services, and internal 10.0.0.0/8 hosts.
**Escalation:** Chained metadata access to obtain IAM temporary credentials, and port-scanned 10.41.0.0/16 to find trusted management services reachable only internally.
**Insight:** Any TURN/STUN relay in a WebRTC stack is an SSRF-equivalent that speaks TCP and UDP, not just HTTP; grab the ephemeral TURN creds from the call-setup API response and test XOR-PEER-ADDRESS against 169.254.169.254 and RFC1918 ranges.

