Understanding WebRTC Leaks: What Every VPN User Must Know
Even if you have an active VPN connection and your browser shows an encrypted tunnel, you may still be completely unmasked to websites you visit. This security failure is known as a WebRTC STUN Leak.
Why Do WebRTC Leaks Happen?
Web Real-Time Communication (WebRTC) is a modern web standard built into Google Chrome, Microsoft Edge, Mozilla Firefox, and Safari. It enables browser-based peer-to-peer audio, video, and data streaming without requiring external plugins or extensions.
To establish a direct connection between two peers through Network Address Translation (NAT) firewalls, WebRTC uses STUN (Session Traversal Utilities for NAT) servers. When a web page requests a STUN lookup, your browser queries external servers to discover its public IP address. In poorly configured VPN setups, the operating system routes these STUN UDP packets outside the virtual network interface directly through your local Wi-Fi or Ethernet adapter, exposing your physical residential IP address to the web server.
How to Read Your Diagnostic Results
- Host Candidates (e.g. 192.168.1.X or 10.X.X.X): These are private IP addresses assigned by your local router. They are non-routable on the public internet and do not expose your identity or physical location.
- Server Reflexive (srflx) Candidates: These are public IP addresses returned by STUN servers. If the srflx IP matches your VPN server's exit address, your VPN is working correctly. If the srflx IP matches your real home internet connection, you are leaking!
- IPv6 Leaks: Many commercial VPNs only tunnel IPv4 traffic. If your ISP assigns you an IPv6 address and your VPN does not block or route IPv6, websites can effortlessly log your physical location via IPv6.
Step-by-Step: How to Permanently Prevent WebRTC Leaks
- Enable System-Level Kill Switch: Ensure your VPN's Kill Switch is set to strictly block all non-VPN network traffic. Both NordVPN and Proton VPN feature advanced kill switches that prevent STUN packet leakage.
- Disable WebRTC in Firefox: Type
about:configin your address bar, search formedia.peerconnection.enabled, and toggle it tofalse. - Chrome & Chromium Browsers: Install the official VPNSecurity.blog Chrome Extension or use extension flags to prevent WebRTC from exposing public interfaces.
- Brave Browser: Open Settings → Privacy and Security → WebRTC IP handling policy → Select "Disable non-proxied UDP".