Files
livekit/pkg
cnderrauberandClaude Opus 5.5 19fd88ecbd turn: refuse TCP relays and limit relays to this host to media ports (#4992)
* turn: refuse TCP relays and limit relays to this host to media ports

Embedded TURN let any participant relay to arbitrary peers (#4924):

- RFC 6062 TCP relays, accepted since pion/turn v5, let a client open TCP
  connections to any permitted address, e.g. SSH on the node itself.
  WebRTC clients never request them, so they are now refused for both
  embedded and standalone TURN.
- Relays to the host's own addresses are delivered locally and bypass any
  firewall in front of the host. Embedded TURN now only relays to this
  host's RTC media UDP ports.
- Carrier-grade NAT, NAT64 and a few other special-purpose ranges are
  added to the restricted peer ranges.

The issue also suggested allowing relays only to the media node's IPs.
That is not done here because, with the changes above, the remaining
relays do not form a security concern: they are UDP only, to public
addresses outside the restricted ranges, and reach a peer exactly as the
client could from its own address (no amplification, no spoofed source).
This is standard TURN behavior. Limiting destinations to media nodes would
also require TURN server to know media node all endpoints, for little benefit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* solve comment

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 23:29:41 +08:00
..
2025-11-28 21:51:53 +05:30