← sources

Security concerns of in-game peer-to-peer comms leaking users' public and private IPs.

source: reddit (reddit:gamedev)published 2026-11-03 04:45ingested 2026-11-04 02:38

retained text

Hi, I'm hoping to get some help on an issue I've identified and potentially get some input on how widespread this issue is in the (indie?) gaming world, as I doubt it's limited to the game I'm looking at.

The issue boils down to in-game voice functionality using STUN and ICE, and the security implications of using them in games - they are leaking players' public and private IP addresses to other players in some scenarios.

For anyone not familiar, ICE elects host candidates as potential IPs to be used in peer-to-peer comms and then tests those candidate pairs by sending Binding Requests packets between them. 

In non-network speak - my game gives other players across the internet my PC's private IP (and vice versa) and then the game tests whether there's connectivity between those two private IPs for a direct connection.

Nine times out of ten that attempt is going to fail because public IPs aren't routable across the 'net. It is going to work for people playing from the same house so as to avoid hairpinning, presumably, and for anyone who has created a tunnel between them. For everyone else, my PC's private IP is sent to your game client and that's visible in the network traffic through these Binding Request packets. 

Learning peoples' private IP's isn't an imminent security risk but it's definitely not ideal from a network security perspective.

If these candidate pairs fail then the game may fall to a TURN relay server instead, and all I have is your private IP.

If a candidate pair is successful and peer-to-peer comms is established, I can then see the other side's public IP address in an XOR/MAPPED-ADDRESS packet as well. In the game that I'm looking at, the game traffic is entirely UDP and continues peer-to-peer to the other players' public IP.

So now it's sharing both public and private IPs. Admittedly the reflexive address won't necessarily be the other player's router IP, it might just be their outermost NATted IP but there will be plenty where it is. 

Having the private and public IP of people across the 'net is worse than just having their private IP. It exposes their network setup and makes targeting them for existing vulnerabilities a lot easier. 

When Web RTC agents were added to browsers and the leak was discovered it was called the WebRTC IP Leak. It was mitigated by the ICE agent replacing the host candidate descriptor with a random UUID which, if a peer was on the same network, would be resolved by mDNS. 

I'm hoping there's an equivalent option for the libraries that you guys build your games with.

This is where I run out of steam though because I am not a software developer, I'm on the networks side. I know php and python in a network context, but C# or any other windows-y/games-y language is well outside my zone. 

The game I'm referring to is an Indie game built in Unity, uses dissonance for in-game comms and Netcode for GameObjects for its network implementation. So I don't know whether the underlying ICE/STUN handling is done by one of the above, or Steamworks, or is handled by the game itself. 

I've taken a look through some documentation for some of the above but can't find any ICE references, I've no idea which one it's in and it could take me days to narrow down. I'm hoping someone who works with this stuff daily can pinpoint it.

Any discussion or opinions welcomed. Even if it's a disagreement on the extent of risk of exposing these addresses - happy to have that conversation too.

document fetched 2026-11-04 00:26 · canonical https://reddit.com/r/gamedev/comments/1xmjsgk/security_concerns_of_ingame_peertopeer_comms