A WebRTC leak is the exposure of a user’s local or public IP address to a website through the browser’s WebRTC connection set-up (ICE candidate gathering), which can reveal addresses that the VPN tunnel is meant to hide.
WebRTC leak explained
WebRTC lets browsers establish direct audio, video and data connections. To find a working path between two peers, the browser gathers “candidates” using the ICE framework (RFC 8445): addresses of local interfaces, and public addresses learned by asking STUN servers (RFC 8489). A web page can start this process with a few lines of JavaScript and read the resulting candidates.
If STUN requests leave through the physical interface instead of the tunnel, or if the browser exposes local interface addresses, a page can learn the user’s real public IP address or internal network addresses. RFC 8828 defines IP-address handling modes for browsers, and current browsers by default replace local addresses with random mDNS host names. This reduces the problem but does not remove it, particularly where policies, extensions or split tunnelling change the routing.
A WebRTC leak is a browser-level issue rather than a fault in the tunnel protocol, but the VPN client’s routing and firewall rules decide whether STUN traffic can escape. VPN browser extensions that only proxy the browser’s web traffic do not necessarily carry WebRTC’s UDP traffic, which makes them more exposed to this leak than a VPN that routes the whole device.
How VPN Labs tests it
VPN Labs runs a controlled ICE-gathering page in current stable releases of the major browsers with the tunnel up, records every candidate the page receives and compares the addresses with the device’s real public IPv4 and IPv6 addresses and local interfaces. The parallel packet capture shows whether STUN binding requests left outside the tunnel.
IPv6 and WebRTC are the two leak paths most often missed in VPN testing. On dual-stack networks a tunnel that carries only IPv4 leaves IPv6 traffic, and the…