Repository navigation
Closed
Description
Describe the bug
If LiveKit is deployed on a dual stack system, it can leak internal addresses and does so regardless of actually making use of both or not. On a dual stack system, it will return addresses for both families at all times.
- If using
use_external_ip: true, STUN will determine the IPv4 address but the advertised IPv6 address will be some node local address. - If
use_external_ip: falseandnode_ip: <ipv4 address>, the given address will be used for the advertised IPv4 addresses but the advertised IPv6 addresses will be some node local address. - If
use_external_ip: falseandnode_ip: <ipv6 address>, the given address will be used for the advertised IPv6 addresses but the advertised IPv4 addresses will be some node local address.
Server
- Version: 1.9.11
- Environment: dual stack systems
Client
N/A
To Reproduce
Steps to reproduce the behavior:
- Ensure running on a dual stack system. You don't even need to bind to both.
- Method 1:
- Set
use_external_ip: false. - Configure a
node_ip, either IPv4 or IPv6 can be used. Use an address not detectable on the host itself. It does not need to be actually reachable.
- Set
- Method 2:
- Have STUN resolve the node IP value (IPv4).
- Connect to LiveKit. You can use the connection tester for this. It does not need to succeed in connecting, it just needs to receive and show you the advertised addresses.
- Observe the returned addresses in the connection tester.
- Note that the addresses for the other address family ends up using some address detected on the node itself.
Expected behavior
- Only addresses for the bound families are advertised.
- All used address families are resolved when using STUN.
- Only addresses configured in
node_ipare advertised (this field should probably be changed to support multiple addresses; Node IP can only be set to 1 value #4318 )
Additional context
Because the above is currently not the case, internal addresses end up being exposed publicly when running on dual stack systems, even if only using one and not both.
Metadata
Metadata
Assignees
Labels
No labels
Activity
cnderrauber commentedon Mar 4, 2026
You can use ipfilter to excludes the internal ip.
In ipv6 there is no NAT like ipv4, can you describe the use case to resolve ipv6 by stun?
Omar007 commentedon Mar 4, 2026
There is, that would be NAT66. Though generally the more relevant one on IPv6 is NPT (stateless), not necessarily NAT66 (stateful, although NAT66 can also cover the NPT use-case).
This is still very relevant when:
a. Multi-homed (and control centralized, not delegated to each individual machine)
b. Only have access to PA prefixes (or even worse, dynamically changing (PA) prefixes (yes, these providers still exist 😬 ))
c. When using fail-over firewalls
Aside from that, the following situations also make this relevant outside of NAT related things:
d. Use of load balancers/(reverse) proxies (and the public address is the same for outgoing and incoming traffic)
My current situation is a combination of 'b' and 'd' (it also used to include 'a' but for now that is not the case).
biglittlebigben commentedon Mar 5, 2026
Can the existing ips/excludes config option work for your purpose?
Omar007 commentedon Mar 5, 2026
It can not. The only use-case that can cover is if you didn't actually want to be running dual stack at all.
davidzhao commentedon Mar 9, 2026
have you tried setting
rtc.external_ip_only: true?cnderrauber commentedon Mar 9, 2026
#4352 will have expected behavior 2 and 3. For 1, we can't do that by default as it will break current applications with only ipv4 node ip set. You can setup ip filter to avoid internal ip leaking in this case.
Omar007 commentedon Mar 11, 2026
Just rebased against master, rebuild and ran. Verified working for cases 2 and 3 and since my addresses are generally stable I don't have to rely on STUN so this works well enough 👍