58 lines
3.0 KiB
Diff
58 lines
3.0 KiB
Diff
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
|
Date: Sat, 9 May 2020 14:42:37 +0200
|
|
Subject: webRTC: do not expose local IP addresses
|
|
|
|
Prevent leaks of local IP address and public IP address (when using VPN)
|
|
|
|
See also:
|
|
* https://github.com/bromite/bromite/issues/553
|
|
* https://github.com/bromite/bromite/issues/589
|
|
|
|
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
|
---
|
|
chrome/browser/ui/browser_ui_prefs.cc | 2 +-
|
|
.../blink/common/peerconnection/webrtc_ip_handling_policy.cc | 5 ++++-
|
|
.../peerconnection/peer_connection_dependency_factory.cc | 2 +-
|
|
3 files changed, 6 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
|
|
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
|
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
|
@@ -147,7 +147,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
|
|
false);
|
|
#endif
|
|
registry->RegisterStringPref(prefs::kWebRTCIPHandlingPolicy,
|
|
- blink::kWebRTCIPHandlingDefault);
|
|
+ blink::kWebRTCIPHandlingDisableNonProxiedUdp);
|
|
registry->RegisterListPref(prefs::kWebRTCIPHandlingUrl, base::ListValue());
|
|
registry->RegisterBooleanPref(prefs::kWebRTCPostQuantumKeyAgreement, false);
|
|
registry->RegisterStringPref(prefs::kWebRTCUDPPortRange, std::string());
|
|
diff --git a/third_party/blink/common/peerconnection/webrtc_ip_handling_policy.cc b/third_party/blink/common/peerconnection/webrtc_ip_handling_policy.cc
|
|
--- a/third_party/blink/common/peerconnection/webrtc_ip_handling_policy.cc
|
|
+++ b/third_party/blink/common/peerconnection/webrtc_ip_handling_policy.cc
|
|
@@ -30,7 +30,10 @@ blink::mojom::WebRtcIpHandlingPolicy ToWebRTCIPHandlingPolicy(
|
|
if (preference == kWebRTCIPHandlingDisableNonProxiedUdp) {
|
|
return blink::mojom::WebRtcIpHandlingPolicy::kDisableNonProxiedUdp;
|
|
}
|
|
- return blink::mojom::WebRtcIpHandlingPolicy::kDefault;
|
|
+ if (preference == kWebRTCIPHandlingDefault) {
|
|
+ return blink::mojom::WebRtcIpHandlingPolicy::kDefault;
|
|
+ }
|
|
+ return blink::mojom::WebRtcIpHandlingPolicy::kDisableNonProxiedUdp;
|
|
}
|
|
|
|
const char* ToString(blink::mojom::WebRtcIpHandlingPolicy policy) {
|
|
diff --git a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
|
|
--- a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
|
|
+++ b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
|
|
@@ -1094,7 +1094,7 @@ PeerConnectionDependencyFactory::CreatePortAllocator(
|
|
break;
|
|
}
|
|
|
|
- VLOG(3) << "WebRTC routing preferences: " << "policy: "
|
|
+ LOG(INFO) << "WebRTC routing preferences: " << "policy: "
|
|
<< ToString(webrtc_ip_handling_policy)
|
|
<< ", multiple_routes: " << port_config.enable_multiple_routes
|
|
<< ", nonproxied_udp: " << port_config.enable_nonproxied_udp
|
|
--
|