WebRTC STUN public IP discovery
A STUN request lets a page discover the public IP of the real network path, even behind some VPNs.
In one line
Can find the public internet address of your real connection, even when some VPNs hide it
A STUN request lets a page discover the public IP of the real network path, even behind some VPNs.
ICE gathering sends UDP to a STUN server and learns the server reflexive address. Proxies and browser VPN extensions that cannot proxy UDP leak the real IP. Chrome WebRTC IP handling policies and Brave default settings block this.
What it can and can't do
What the user does: Nothing. A page can start a call setup without any pop up
It can
- Ask an outside server what your public address looks like
- Find your real address if a VPN or proxy does not carry call traffic
- Compare it with your claimed address to spot hiding
It cannot
- Bypass a VPN that carries all traffic, including call traffic
- See your address when you turn on browser protections that block it, such as in Brave or Chrome policies
- See your name or account
- Do this without a script running on the page
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 23 | 2012-11-06 | None |
| Edge | Supported | 15 | 2017-04-05 | None |
| Firefox | Supported | 44 | 2016-01-26 | None |
| Safari | Supported | 11 | 2017-09-19 | None |
| Safari on iPhone | Supported | 11 | 2017-09-19 | None |
| Chrome on Android | Supported | 25 | 2013-02-27 | None |
| Samsung Internet | Supported | 1.5 | 2013-09-25 | None |
How a site asks for it
| API | new RTCPeerConnection({iceServers:[{urls:'stun:...'}]}); srflx candidates |
| Browser compat keys | api.RTCIceCandidate |
| How access is granted | none |
| What the user sees | Not listed |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Not listed |
| How to take it back | Not listed |
| Inside an iframe | Not listed |
Typical flow
- Open peer connection with a STUN server
- Read srflx candidate
- Compare with HTTP IP
Data you get
What comes back: Public IPv4 or IPv6
Shape: string
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
srflx address | string | None | IPv4 or IPv6 | exact |
Technical limits
- Brave and Firefox (media.peerconnection.ice.default_address_only) can limit candidates
- Chrome policy setting disable_non_proxied_udp restricts it
The story
What it is
A page can ask a helper server for your real public internet address, sometimes beating a VPN.
For you
You never see it. A page can start a hidden call setup and learn the public address your device really uses. If your VPN only covers some traffic, your real address may leak.
For makers
Makers need this step so calls and games can connect through home routers. It is also used by fraud tools to see past proxies. Privacy tools block or limit it, which can break calls.
Where you see it
| Type | Example | Apps |
|---|---|---|
| video | Zoom or Google Meet in the browser asks a helper server what public address you appear to have, then shares it so the other person can reach you directly. | Zoom, Google Meet |
| games | A browser multiplayer game with direct player links uses it so two players behind home routers can connect, without paying for a relay. | None named |
| security | A bank's fraud script sets up a hidden call to learn the real address behind a VPN, and flags a mismatch with the connection address. | None named |
| ads | An ad tech script reads the real public address behind a proxy to catch click fraud from hidden networks. | None named |
| video | A cloud gaming site uses it to pick the closest game server and the best path for the live video stream. | GeForce NOW |
| shopping | A fraud tool at checkout compares the address from the call setup with the address on the page request. Different values raise the risk score. | None named |
| developer | A developer opens browser leak test pages to check if their VPN hides the real address during calls. | BrowserLeaks |
Risks
- VPN leak
- Used to unmask visitors
Good uses and abuse
Legitimate uses
- Calling apps
Known abuse
- Defeating VPN and proxy privacy
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 3 | Rough identifying entropy, when known |
Related capabilities
Related
- WebRTC ICE host candidates (mDNS). Can try to find your device's home network address, but browsers now hide it
Sources
How well checked: Based on official documentation.