Skip to content
Glossary

What is a WebRTC leak?

Definition

A WebRTC leak is a network address disclosed by the browser's real-time communication stack, outside the path your proxy controls.

Pointing a browser at a proxy does not route WebRTC through it, and a page does not need to start a call, ask for the camera or show any prompt to collect what the browser finds. Creating a peer connection and asking it to gather candidates is enough. The candidates arrive in JavaScript, and one of them can carry the public address of the network the browser is really on.

WebRTC leak test

Runs in your browser

When a page opens a WebRTC connection, your browser lists every address it could be reached on. A proxy normally carries only your web traffic, so a public address here that is not the one our server saw is an address the proxy does not cover.

Gathering WebRTC candidates...

Why the proxy never sees it

Candidate gathering talks to STUN servers over UDP. RFC 8828 notes that HTTP proxies and most SOCKS proxies do not carry UDP, and its own principles say WebRTC traffic should not be sent through proxies by default, for media-quality reasons. So the page’s HTTP requests follow your proxy setting while its STUN queries take the ordinary route, and the server-reflexive candidate that comes back holds whatever public address that route uses. Behind a residential or mobile exit, that is the address you were trying not to show.

What one browser exposed under each setting

We gathered candidates in Chrome for Testing 148.0.7778.96 (the headless shell) on macOS 26.6.2, once under each value of Chromium’s WebRTC IP handling policy, passed with --force-webrtc-ip-handling-policy. The page used one public STUN server and reported only the candidate type and the class of address, never the address itself.

Policy value Closest RFC 8828 mode Host candidate Server-reflexive candidate
default Mode 1, with local addresses replaced by mDNS names A random .local name Public IPv4
default_public_and_private_interfaces Mode 2: default route plus its local addresses The real private IPv4 address Public IPv4
default_public_interface_only Mode 3: default route only None Public IPv4
disable_non_proxied_udp Mode 4: force proxy None None

The default run was repeated and gave the same result. We then loaded the same page through a local SOCKS5 server that logs every request. Its log shows the page itself arriving through the proxy, and the browser still produced a public server-reflexive candidate under the default policy, because the STUN query never went near the proxy. Under disable_non_proxied_udp nothing was gathered at all. The four value names come from Chromium’s extension API definition; matching them to RFC 8828’s modes is our reading of the names against the RFC, not something either document states.

Measured on 21 October 2026: one browser build, one launch per policy value plus one repeat of the default, one STUN server (stun.l.google.com:19302). No IPv6 candidate appeared in any run. A browser with media permission granted, a different build or a network that hands out IPv6 can expose more.

Checking your own setup

Paste this into the developer console of the browser profile you automate, through the proxy you use. It is the code from the measurement above, without the step that replaced addresses with a class:

const pc = new RTCPeerConnection({ iceServers: [{ urls: "stun:stun.l.google.com:19302" }] });
pc.createDataChannel("probe");
pc.onicecandidate = (e) => {
  if (e.candidate) console.log(e.candidate.type, e.candidate.protocol, e.candidate.address);
  else console.log("gathering complete");
};
pc.createOffer().then((o) => pc.setLocalDescription(o));

Compare every srflx address with the address your exit presents over HTTP. Any candidate that is neither the exit address nor a .local name is visible to every page that runs the same code. If you drive a headless browser, put this in the test harness rather than checking once, because a browser update can change the default without anything in your code changing. Proxies for AI agents that browse covers holding one identity per task across everything a browser sends, and what a proxy does not do explains why the address is only one of the signals.

Fixing it without breaking the page

Forcing the proxy route, as disable_non_proxied_udp does, removed every candidate in the test while leaving the API in place. Deleting WebRTC entirely also stops the leak, but a site that expects RTCPeerConnection to exist can notice that it does not, and a missing standard API is a fingerprinting signal of its own. Restricting the policy is usually the better trade. It is also a different fault from a DNS leak, which discloses hostnames to a resolver: this one discloses addresses to the page, and fixing one does nothing for the other.

Frequently asked questions

Can a website read my IP address through WebRTC without asking permission?
It can ask the browser to gather candidates, and no media prompt appears. In our test of Chrome for Testing 148 with default settings, the page received an mDNS name instead of the local address and a server-reflexive candidate carrying the public address of the route the STUN query took. What a given browser exposes depends on its policy setting and build, so test the one you use.
Does a proxy or VPN stop WebRTC leaks?
A browser proxy setting does not, because STUN uses UDP and HTTP proxies and most SOCKS proxies do not carry it. A VPN that routes all of the machine's traffic changes the route the STUN query takes, so the server-reflexive candidate shows the VPN's exit address; under a permissive policy the host candidates can still list local interfaces. For a proxy, the browser has to be told to keep UDP off any non-proxied path, as Chromium's disable_non_proxied_udp policy does.

Sources

  1. RFC 8828: WebRTC IP Address Handling Requirements, the four modes and the note on UDP through proxies
  2. W3C WebRTC: Real-Time Communication in Browsers, RTCPeerConnection and ICE candidate gathering
  3. Chromium source: privacy.json, the four IPHandlingPolicy values
  4. IETF draft (expired): Using Multicast DNS to protect privacy when exposing ICE candidates

All terms, A to Z