WebRTC IP Leak
What is WebRTC IP Leak?
WebRTC IP LeakA browser-side leak in which WebRTC's STUN/ICE machinery exposes a user's real local and public IP addresses, even when a VPN or proxy is active.
WebRTC enables peer-to-peer audio, video, and data channels directly in the browser. To establish a direct path through NAT it runs the ICE framework (RFC 8445): the browser enumerates every local network interface and queries external STUN servers (RFC 8489) to learn its public, server-reflexive address. Any script can create an RTCPeerConnection, call createOffer(), and read the resulting ICE candidates from the SDP — recovering the user's real LAN IP and public IP without any permission prompt, and without sending traffic through the page's own TCP connection. This bypasses VPNs and HTTP proxies that only tunnel TCP, because WebRTC prefers UDP and binds to the physical interface.
Daniel Roesler's widely-shared 2015 proof-of-concept made the issue famous, and it remains a reliable deanonymization and cross-device-tracking vector used by ad tech and fraud-detection vendors alike. The main modern mitigation is mDNS candidate obfuscation: Chrome and Firefox now replace private addresses with random *.local hostnames so sites see no raw RFC 1918 IP. Further defences include forcing proxied UDP, the WebRTC Network Limiter extension, VPN clients that patch the browser policy, or disabling WebRTC for high-threat profiles.
flowchart TD P[Web page JS] --> R[new RTCPeerConnection<br/>createOffer] R --> ICE[ICE gathering] ICE --> LAN[Enumerate local<br/>interfaces → LAN IP] ICE --> STUN[Query STUN server over UDP] STUN --> PUB[Server-reflexive<br/>real public IP] LAN --> CAND[ICE candidates in SDP] PUB --> CAND CAND --> READ[Script reads candidates] READ --> LEAK[Real IP exposed<br/>despite VPN/proxy] M[mDNS .local obfuscation] -. replaces .-> LAN
● Examples
- 01
A site running RTCPeerConnection and reading ICE candidates to log the visitor's real public IP behind a VPN.
- 02
An ad tag using WebRTC to enumerate internal LAN addresses for cross-device tracking.
● Frequently asked questions
What is WebRTC IP Leak?
A browser-side leak in which WebRTC's STUN/ICE machinery exposes a user's real local and public IP addresses, even when a VPN or proxy is active. It belongs to the Privacy & Data Protection category of cybersecurity.
What does WebRTC IP Leak mean?
A browser-side leak in which WebRTC's STUN/ICE machinery exposes a user's real local and public IP addresses, even when a VPN or proxy is active.
How do you defend against WebRTC IP Leak?
Defences for WebRTC IP Leak typically combine technical controls and operational practices, as detailed in the full definition above.
What are other names for WebRTC IP Leak?
Common alternative names include: WebRTC leak, STUN leak.