If it's possible, we should filter them out to prevent revealing more information than necessary. Serene and I guessed that they are only there for the case when both peers are in the same local network, but we're not sure about that.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
The WebRTC working draft touches on this issue:
https://www.w3.org/TR/2016/WD-webrtc-20160128/#revealing-ip-addresses
Even without WebRTC, the Web server providing a Web application will know the public IP address to which the application is delivered. Setting up communications exposes additional information about the browser’s network context to the web application, and may include the set of (possibly private) IP addresses available to the browser for WebRTC use. Some of this information has to be passed to the corresponding party to enable the establishment of a communication session.
Revealing IP addresses can leak location and means of connection; this can be sensitive. Depending on the network environment, it can also increase the fingerprinting surface and create persistent cross-origin state that cannot easily be cleared by the user.
A connection will always reveal the IP addresses proposed for communication to the corresponding party. The application can limit this exposure by choosing not to use certain addresses using the settings exposed by the RTCIceTransportPolicy dictionary, and by using relays (for instance TURN servers) rather than direct connections between participants. One will normally assume that the IP address of TURN servers is not sensitive information. These choices can for instance be made by the application based on whether the user has indicated consent to start a media connection with the other party.
Mitigating the exposure of IP addresses to the application itself requires limiting the IP addresses that can be used, which will impact the ability to communicate on the most direct path between endpoints. Browsers are encouraged to provide appropriate controls for deciding which IP addresses are made available to applications, based on the security posture desired by the user. The choice of which addresses to expose is controlled by local policy (see RTCWEB-IP-HANDLING for details).
Thanks for working on this! Thanks for keeping the option to leave the local addresses in as well.
That's unfortunate that the "public"RTCIceTransportPolicy was removed from the specification. It would be nicer if we could prevent the candidate from being included in the SDP instead of grepping for it afterwards, but I don't see a way to do that with the OnICECandidate callback.
Some comments:
FIXME: Should this check ip.IsLoopback() and others? I'd like to include 0.0.0.0 and 127.0.0.1 addresses in this, especially after dcf found #33157 (moved).
Let's expand the tests and include one for each type of local address
It's worth implementing this for each of the proxies as well.
Is there a way for us to use the other built-in functions in the net package for determining whether or not the IP address is local?
FIXME: Should this check ip.IsLoopback() and others? I'd like to include 0.0.0.0 and 127.0.0.1 addresses in this, especially after dcf found #33157 (moved).
The condition now looks like IsLocal(ip) || ip.IsUnspecified() || ip.IsLoopback(), which includes these addresses.
Let's expand the tests and include one for each type of local address
Done
It's worth implementing this for each of the proxies as well.
Can this be a follow up?
Is there a way for us to use the other built-in functions in the net package for determining whether or not the IP address is local?
FIXME: Should this check ip.IsLoopback() and others? I'd like to include 0.0.0.0 and 127.0.0.1 addresses in this, especially after dcf found #33157 (moved).
I feel that the 0.0.0.0 is unrelated to anything involving candidate addresses. 0.0.0.0 is appearing in the o= origin field and the c= connection information field (the latter is what remoteIPFromSDP looks at), not in an a=candidate attribute.
However, I imagine that if a LAN address appears as a a=candidate, that may also cause it to appear in o= or c=, and we may have to additionally deal with that when #33157 (moved) is figured out.
Is it necessary to test IsICECandidate, or could you skip it and just check the err result of ToICECandidate?
The attributes loop is structured like this, with attrs = append(attrs, a) in three places:
for a in attributes { if a.IsICECandidate() { ice, err = a.ToICECandidate() if err != nil { attrs = append(attrs, a) continue } if ice.Typ == "host" { ip = net.ParseIP(ice.Address) if ip == nil { attrs = append(attrs, a) continue } if IsLocal(ip) { /* no append in this case */ continue } } } attrs = append(attrs, a)}
Consider restructuring so that you only continue in the "skip" case, and all other cases fall through to attrs = append(attrs, a). Expressing the logic: if a candidate, and type=="host", and an IP address, and IP address is local, skip; otherwise keep.
for a in attributes { if a.IsICECandidate() { ice, err = a.ToICECandidate() if err == nil && ice.Typ == "host" { ip = net.ParseIP(ice.Address) if ip != nil && IsLocal(ip) { /* no append in this case */ continue } } } attrs = append(attrs, a)}
But also possibly with my note about ToICECandidate above:
for a in attributes { if ice, err = a.ToICECandidate(); err == nil { if ice.Typ == "host" { ip = net.ParseIP(ice.Address) if ip != nil && IsLocal(ip) { /* no append in this case */ continue } } } attrs = append(attrs, a)}
The attributes loop is structured like this, with attrs = append(attrs, a) in three places:
{{{
for a in attributes {
if a.IsICECandidate() {
ice, err = a.ToICECandidate()
if err != nil {
attrs = append(attrs, a)
continue
}
if ice.Typ == "host" {
ip = net.ParseIP(ice.Address)
if ip == nil {
attrs = append(attrs, a)
continue
}
if IsLocal(ip) {
/* no append in this case */
continue
}
}
}
attrs = append(attrs, a)
}
}}}
Consider restructuring so that you only continue in the "skip" case, and all other cases fall through to attrs = append(attrs, a). Expressing the logic: if a candidate, and type=="host", and an IP address, and IP address is local, skip; otherwise keep.
{{{
for a in attributes {
if a.IsICECandidate() {
ice, err = a.ToICECandidate()
if err == nil && ice.Typ == "host" {
ip = net.ParseIP(ice.Address)
if ip != nil && IsLocal(ip) {
/* no append in this case */
continue
}
}
}
attrs = append(attrs, a)
}
}}}
But also possibly with my note about ToICECandidate above:
{{{
for a in attributes {
if ice, err = a.ToICECandidate(); err == nil {
if ice.Typ == "host" {
ip = net.ParseIP(ice.Address)
if ip != nil && IsLocal(ip) {
/* no append in this case */
continue
}
}
}
attrs = append(attrs, a)
}
}}}
LGTM. I guess for browser-based proxies that depends on how much effort it is. I'm okay with making it lower priority, but if that's the case let's either leave this ticket open or make a new ticket to track it.
I guess for browser-based proxies that depends on how much effort it is. I'm okay with making it lower priority, but if that's the case let's either leave this ticket open or make a new ticket to track it.
Ok, it's probably not too great an effort, just not really a priority. I filed #33744 (moved) for that.
Trac: Status: merge_ready to closed Resolution: N/Ato fixed