WebRTC: `icecandidateerror.address` leaks the host's real public subnet when TURN/TCP goes through the proxy
Summary
On the latest engine build, the main WebRTC leaks are fixed. Host candidates are hidden behind mDNS, srflx candidates match the proxy exit, and the self-connection trick (Forter ice-pi, getStats() → remote-candidate) no longer reveals the host IP.
There is still one leak. When a TURN-over-TCP allocation fails, the RTCPeerConnectionIceErrorEvent.address field contains the local address of the host's network interface. Chrome masks only the last octet (203.0.113.x), so any page learns the /24 of the machine the browser actually runs on. That subnet is the same for every profile on the host, and in our case it identifies the hosting provider.
Environment
- Engine: latest version,
2.1.3(Chromium 156) - Launched via the Python SDK
launch_temporary(...)with a proxy, default WebRTC mode - Proxy: residential SOCKS5 with UDP support (UDP ASSOCIATE works; all UDP reaches the target through the proxy exit)
- Host: Windows VPS with a public IP assigned directly to the NIC (no NAT)
Steps to reproduce
- Launch a profile with a SOCKS5 proxy that supports UDP.
- Open any HTTPS page and run the snippet below. Point it at any TURN server that rejects the allocation (bad credentials are enough).
const pc = new RTCPeerConnection({
iceServers: [{
urls: ['turn:turn.example.com:3478?transport=udp', 'turn:turn.example.com:3478?transport=tcp'],
username: 'test', credential: 'wrong'
}]
});
pc.onicecandidateerror = e => console.log(e.url, e.errorCode, e.errorText, e.address, e.port);
pc.createDataChannel('x');
pc.createOffer().then(o => pc.setLocalDescription(o));
Actual result
| url | errorCode | errorText | address |
|---|---|---|---|
turn:…:3478?transport=udp |
403 | TURN allocate error. | 0.0.0.x |
turn:…:3478?transport=tcp |
403 | TURN allocate error. | 203.0.113.x ← host NIC subnet |
turn:…:3478?transport=tcp |
403 | TURN allocate error. | 203.0.113.x |
stun:… (several) |
701 | UDP socket was closed. | [0:0:0:x:x:x:x:x] |
In the same session, the TURN server itself saw both the UDP and TCP allocations coming from the proxy exit IP. So the traffic is proxied correctly: the leak is only in what the event reports to JavaScript.
- HTTP / UDP / TURN source IP seen by the server: the proxy exit (e.g.
173.168.x.x) icecandidateerror.addressfor TCP:203.0.113.x, the host machine's public subnet
The UDP rows (0.0.0.x) and the IPv6 rows ([0:0:0:x:…]) reveal nothing. The problem is only the TCP rows.
Expected result
address should not expose the real interface when the connection is made through the proxy. Either:
null, which is what the WebRTC spec requires when the local address has not been exposed as part of a local candidate (and it hasn't: host candidates are mDNS-masked), or- the proxy exit address, consistent with the spoofed srflx/relay candidates.
Why it matters
A real user behind a home router gets a private address here (192.168.x.x). A user with a public IP gets the subnet of their own IP. Getting a public subnet that does not contain the visitor's IP is a clear signal: the browser runs on a different machine than the one the traffic comes from. It also links every profile running on the same host. Anti-fraud scripts can read this with a few lines of JS, and the TURN server doesn't even have to accept the connection.
Workaround
The leak disappears with webrtc="block", but that disables WebRTC entirely, which is itself a detection signal.
in v2.1.4