WebRTC IP Leak Prevention with mDNS for AI Voice Agents in 2026
Default WebRTC ICE gathering still leaks private LAN IPs to remote peers. mDNS obfuscation, host candidate filtering, and STUN/TURN forced relay close the gap for production AI voice apps.
Default WebRTC ICE gathering still leaks private LAN IPs to remote peers. mDNS obfuscation, host candidate filtering, and STUN/TURN forced relay close the gap for production AI voice apps.
The threat
When a browser opens an RTCPeerConnection, ICE gathering enumerates every local IPv4/IPv6 address on every interface and sends it to the remote peer in SDP. Pre-mDNS, that meant 192.168.x.x, 10.x.x.x, and even VPN tunnel IPs leaked to anyone who could see the offer/answer. In 2026, modern detection systems combine WebRTC IP data with timing patterns and ICE candidate counts to fingerprint users across sessions, incognito, and VPNs (Security.org). For a voice AI vendor, that is a HIPAA, GDPR, and customer-trust catastrophe — internal hostnames and private subnets are reconnaissance gold for attackers.
Defense
Chrome, Edge, and Safari now replace host candidates with random <uuid>.local mDNS names by default; Firefox exposes media.peerconnection.ice.obfuscate_host_addresses. Production hardening adds three more layers: (1) set iceTransportPolicy: "relay" on every RTCPeerConnection that does not need direct LAN paths, forcing TURN; (2) sanitize SDP server-side to strip any non-mDNS host candidates that slip through; (3) ban enumerateDevices() calls before user permission to kill the second leak vector.
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
flowchart TD
A[Browser RTCPeerConnection] --> B{iceTransportPolicy}
B -- relay --> C[TURN only · public IP only]
B -- all --> D[Host candidates gathered]
D --> E{mDNS enabled?}
E -- yes --> F[uuid.local opaque name]
E -- no --> G[Real LAN IP leaks]
F --> H[SDP sanitizer strips non-mDNS]
C --> H
H --> I[Safe SDP to remote peer]
CallSphere implementation
CallSphere runs 37 production agents · 90+ tools · 115+ Postgres tables · 6 verticals · HIPAA + SOC 2 aligned. Every browser-side voice session uses iceTransportPolicy: "relay" against our hardened TURN fleet, mDNS is required, and an SDP munger drops any candidate whose connection-address is not a .local hostname or our public TURN IP. The Real Estate vertical "OneRoof Pion Go gateway 1.23" terminates Pion-based WebRTC inside the VPC so realtor LAN ranges never reach the cloud. Plans: $149 Starter / $499 Pro / $1,499 Scale, 14-day no-card trial, 22% recurring affiliate Year 1.
Build steps
- Set
iceTransportPolicy: "relay"on RTCPeerConnection - Force-enable mDNS (Chrome flag
--enable-features=WebRtcHideLocalIpsWithMdns) - Server-side regex strip non-
.localhost candidates from SDP - Block
enumerateDevicesuntilgetUserMediaresolves - Pen-test with Mozilla Observatory + a WebRTC leak test page
FAQ
Does relay-only kill p2p latency? Adds ~10-30 ms vs direct host. Trivial for voice; never noticeable in PSTN-style flows.
Will mDNS break my SFU? No — SFUs do not need host candidates. They use server-reflexive (STUN) or relay (TURN).
Still reading? Stop comparing — try CallSphere live.
CallSphere ships complete AI voice agents per industry — 14 tools for healthcare, 10 agents for real estate, 4 specialists for salons. See how it actually handles a call before you book a demo.
What about IPv6 leaks? Same fix. mDNS obfuscates v6 host candidates too.
Is mDNS enough for GDPR? Combined with TLS, DTLS-SRTP, and SDP sanitization, yes. Document it in your DPIA.
Can I detect leak in CI? Yes — spin headless Chrome, capture SDP, regex-fail on bare RFC1918 addresses.
Sources
- Security.org - WebRTC Leaks: A Complete Guide - https://www.security.org/vpn/webrtc-leak/
- Mozilla - One-time permissions are here to stay - https://blog.mozilla.org/webrtc/one-time-permissions-are-here-to-stay/
- WebRTC Security Study - https://webrtc-security.github.io/
- TrustMyIP - WebRTC IP Leak Test & Fix Guide 2026 - https://trustmyip.com/blog/webrtc-ip-leak-test-fix
Try CallSphere AI Voice Agents
See how AI voice agents work for your industry. Live demo available -- no signup required.