WebRTC leak: what it is and how to fix it

WebRTC, the browser technology behind video calls, can tell any site the addresses your device is reachable at, without asking permission. It leaks when the public address among them is your provider's while the VPN is on. A tunnel for the whole system normally hides it; a browser proxy, split tunneling or IPv6 past the tunnel can let it through. A test with the VPN off and on tells you in a minute.

Updated

On this page

What WebRTC tells a site

WebRTC carries video calls, voice chat and screen sharing straight between browsers. To connect two people directly, the browser gathers ICE candidates: every address at which it could be reached. No camera or microphone is needed: a few lines of JavaScript collect the candidates in a second and read them. Any site can do this quietly; a WebRTC leak test does the same in the open.

  • host — the addresses of your own network adapters: 192.168.x.x from the router, the VPN adapter's address, sometimes a global IPv6.
  • srflx (server reflexive) — your public address as a STUN server sees it. The browser sends a short UDP request to a STUN server and gets back the address the request came from. This is the one that can give you away.
  • relay — the address of a TURN relay server, if the site uses one. It belongs to the relay, not to you.

Local addresses and .local names

An address like 192.168.1.5, 10.0.0.7 or one starting with fe80 works only inside your home or office network. It shows neither your provider nor your city, though it can help a site tell one visitor from another. That is why modern browsers, Chrome, Edge and Firefox among them, replace local addresses with a random name such as 5f3c9a1e-….local (this is called mDNS). A site you allowed to use the camera or microphone may get the real ones, since a call within one network needs them.

When the public address leaks

The srflx candidate is simply the address the STUN request left from. Through a tunnel for the whole system the request goes into the VPN like everything else, and the STUN server sees the VPN server. Your real address shows up when the request goes another way, and then a site sees one address for the page and another in WebRTC:

  • The VPN works as a browser proxy — an extension or a proxy setting carries the pages, but WebRTC sends its UDP requests straight to the network, past the proxy.
  • A system proxy instead of a tunnel — some clients only set a proxy in the system settings. Browsers follow it for pages, while WebRTC's UDP goes direct. A client in TUN mode, with a virtual network adapter, has no such gap.
  • Split tunneling lets the browser go direct — in “only selected through the VPN” mode everything not on the list goes direct, the browser included; in the other mode the browser may be among the exceptions. That is the rules at work, not a hole in the tunnel.
  • IPv6 past an IPv4-only tunnel — the browser gathers candidates over IPv6 too. If your provider gives you IPv6 and the tunnel carries only IPv4, your real IPv6 address can show up.

How to test for a WebRTC leak

The free test at /tools/webrtc-leak/ runs entirely in your browser: for the public address the browser asks public STUN servers of Google and Cloudflare, as in any call, and the addresses it finds are not sent to our site. Only you know which address is yours, so run it twice.

  1. 1

    Run it with the VPN off

    Note the public address: it is your provider's, the one you want to hide.

  2. 2

    Connect the VPN and run it again

    Wait until the client says it is connected, and use the same browser.

  3. 3

    Compare

    With the VPN on, the public address should be the VPN server's, the same one an IP check site shows. Your provider's address there is a leak, and so is the IPv6 address you saw with the VPN off.

  4. 4

    Repeat in every browser

    Each browser has its own extensions, settings and split tunneling rules.

Tell the cause by what you see

  • The public address is your provider's, while IP check sites show the VPN

    CauseThe VPN works as a proxy in the browser or the system, and WebRTC's UDP goes past it

    What to doA client with a tunnel for the whole system (TUN), or limit WebRTC in the browser

  • The public address and IP check sites both show your own address

    CauseThe VPN isn't up yet, or split tunneling sends the browser direct

    What to doWait for Connected, check the mode and the exceptions, reconnect

  • IPv4 is the server's, but your own IPv6 shows up too

    CauseIPv6 goes past a tunnel that carries IPv4 only

    What to doA profile that carries IPv6 too, or IPv6 off in the system or on the router

  • One browser shows the VPN's address, another shows yours

    CauseA proxy extension or a built-in VPN in the second browser, or a rule for it

    What to doCheck that browser's extensions and its place in the rules

  • Only random names ending in .local among local addresses

    CauseThe browser hides local addresses (mDNS)

    What to doNothing: this is how it should be

  • Real local addresses like 192.168.1.5

    CauseAn older browser, a site with camera access, or the hiding turned off

    What to doNot a leak of your public address; update the browser if you'd rather hide them

  • No public address at all

    CauseThe browser limits WebRTC, or UDP to STUN servers doesn't get through

    What to doNothing leaks; if calls in the browser fail, look at its WebRTC limits

How to close the leak

Start with the tunnel, not the browser: turning WebRTC off is a last resort. With a full tunnel there is nothing to hide, since WebRTC shows the VPN server like every other connection.

  • A tunnel for the whole system — the surest fix: a client with a virtual network adapter (TUN) takes UDP too, so STUN requests go through the VPN. A proxy extension doesn't cover WebRTC.
  • Keep the browser in the tunnel — don't put it among the exceptions, or add it to the list in “only selected through the VPN” mode. Rules take effect after reconnecting.
  • Close IPv6 — a profile that carries IPv6 through the tunnel, or IPv6 off in the system or on the router.
  • Firefox — open about:config, find media.peerconnection.enabled and set it to false. This turns WebRTC off completely: calls and screen sharing on websites stop working.
  • Chrome, Edge and other Chromium browsers — there is no WebRTC switch in their settings. Privacy extensions and some ad blockers can limit it; take them only from the browser's official store.
  • Check again — after any change, reconnect the VPN and run the test once more.

In Veli

The browser goes through the tunnel with everything else

On a computer Veli takes the whole system's traffic through a virtual network adapter, so the browser's STUN requests go into the tunnel too, and the WebRTC test shows the VPN server. If it shows your address, open Apps and sites: in “Through the VPN only…” the browser goes direct unless it is on the list, and in “Everything through the VPN except…” it may be among the exceptions. After a change, press “Reconnect”. On Android the same screen decides per app.

Diagnostics → Privacy shows the IPv4 and IPv6 addresses and DNS servers that sites see, and says “There is a leak” when something goes past the tunnel. It checks from the app; what WebRTC in a browser gives away, the test in that browser shows.

FAQ

What is a WebRTC leak?

It is when WebRTC, the browser technology for calls, shows a site your real public address while the VPN is on. A site can read these addresses without asking for any permission.

Is a WebRTC leak dangerous?

A site learns your real address, and with it your provider and rough location, and sees that you use a VPN. It doesn't see what you do through the tunnel.

Does a VPN stop WebRTC leaks?

One that tunnels the whole system usually does: the STUN request goes through the tunnel. A browser proxy or a system proxy usually doesn't, because WebRTC's UDP goes past it.

Should I turn WebRTC off?

Only if you can't keep the browser in the tunnel. Without WebRTC, video calls, voice chat and screen sharing on websites stop working.

Is it the same as a DNS leak?

No. A DNS leak shows who answers your questions about site names, a WebRTC leak shows your address. Check both.

Keep the browser in the tunnel

On a computer Veli takes the whole system's traffic through the tunnel, the browser's WebRTC included, and Diagnostics → Privacy shows the IPv4, IPv6 and DNS that sites see.