Analysing Leakage During VPN Establishment in Public Wi-Fi Networks
Total Page:16
File Type:pdf, Size:1020Kb
The final publication is available at IEEE via https://doi.org/10.1109/ICC42927.2021.9500375 Analysing Leakage during VPN Establishment in Public Wi-Fi Networks Christian Burkert, Johanna Ansohn McDougall, Hannes Federrath and Mathias Fischer Universität Hamburg {burkert,ansohn.mcdougall,federrath,mfischer}@informatik.uni-hamburg.de Abstract—The use of public Wi-Fi networks can reveal popular third-party clients fall short in protecting user privacy sensitive data to both operators and bystanders. A VPN can during the establishment of VPN connections. To summarise, prevent this. However, a machine that initiates a connection we make the following contributions: to a VPN server might already leak sensitive data before the VPN tunnel is fully established. Furthermore, it might not be • We systematise the current state of system APIs for immediately possible to establish a VPN connection if the network VPNs. requires authentication via a captive portal, thus increasing the • We analyse OS mechanisms for captive portal detection. leakage potential. In this paper we examine both issues. For that, • We examine the behaviour and leakage of native and we analyse the behaviour of native and third-party VPN clients on various platforms, and introduce a new method called selective third-party VPN clients, including in captive networks. VPN bypassing to avoid captive portal deadlocks. • We introduce Selective VPN Bypassing, a concept of Index Terms—wi-fi, hotspot, vpn, privacy, captive portal gradual and selective network capability management to avoid leakage during captive network remediation and I. INTRODUCTION VPN connection establishment. Public Wi-Fis supply Internet connectivity on the go. How- The remainder of this paper is structured as follows: In ever, their usage comes with considerable privacy risks: A Sect. II, we provide background and terminology. Sect. III Wi-Fi operator can monitor all traffic, analyse the metadata presents related work. In Sect. IV, we define the requirements and, in case of unencrypted connections, even expose its users for a secure VPN establishment. Sect. V describes the status to nearby sniffers and attackers [1], [2]. VPNs are used to quo on VPN APIs. In Sect. VI, we analyse VPN clients and mitigate these dangers by applying an additional layer of en- APIs for violations of our security requirements. Sect. VII cryption. However, they can also give a false sense of security: proposes a design for a leak-free VPN establishment, before Leakage of traffic can already occur while a user attempts to Sect. VIII concludes the paper. connect to a VPN, and a captive portal might even force the II. BACKGROUND AND TERMINOLOGY user to temporarily disable the VPN altogether, because—as we will show in this paper—many VPN clients interfere with In this section, we briefly describe key concepts of Wi- captive portal detection. After joining the network, running Fi communication, captive portals and VPNs, and introduce applications like mail or chat clients will themselves attempt additional terminology used throughout the paper. to connect to their servers. During the time the VPN is not yet A Public Wi-Fi or Hotspot is a 802.11 Wi-Fi network that is established, this might leak potentially sensitive information open to the public, i. e., accepts connections from any client. about a user’s habits, preferences, or work environment to the Unless explicitly stated, we assume public Wi-Fis to operate network. without encryption. To mitigate the potential dangers of surfing VPNs were originally designed to establish connectivity to in an unencrypted public Wi-Fi, users can decide to increase remote private networks and to access their remote services. their security by utilising a VPN. With respect to VPNs, we Nowadays, they are mostly used for privacy-friendly surfing: introduce the term VPN Bootstrapping: It describes the process They aim at masking the original source IP addresses with of blocking all traffic except that required to establish the VPN that of the VPN endpoint and thereby protecting their users, connection until the VPN tunnel is successfully established. e. g., from observation by Internet Service Providers (ISPs). While public Wi-Fis can often be used without special For that use case, it is crucial that all traffic is routed via the access rights, providers can present their customers with a VPN tunnel and nothing is leaked to the intermediate network Captive Portal (CP): A website that users are automatically besides the VPN connection itself. redirected to that contains terms of service and sometimes With this paper, we are the first to examine the issue of the necessity to input credentials. Until the terms of the secure VPN establishment in captive networks and present captive portal are fulfilled, access to the Internet is blocked. evidence that native VPN clients shipped with Windows, The process of signing-in and lifting the network block is remediation Captive Network macOS, iOS, Android, and Ubuntu/GNU Linux, as well as denoted as . We use the term (CN) to refer to hotspots containing a captive portal. CPs can be explicitly announced via a DHCP option or a Router IEEE ICC 2021. ©2021 IEEE. DOI 10.1109/ICC42927.2021.9500375 Advertisement (RA) extension, which informs the client of the URI needed to access the authentication page. While these R4: Blocking Fail State: Outbound traffic continues to be announcement options exist and have been standardised [3], blocked if a VPN tunnel cannot be successfully estab- they are not widely adopted in practice. Instead, platforms lished (e. g., if the VPN endpoint is unreachable). apply heuristics to detect captive networks: Upon successfully R5: No Tunnel Bypass: After successful VPN tunnel estab- connecting to a network, clients send out HTTP requests to lishment, no non-VPN traffic, such as previously started a predefined URL, expecting a predefined response, e. g., an TCP streams, bypass the tunnel. Instead, any preexisting HTTP status code 204. A CN instead replies with an HTTP connection is interrupted and reestablished through the redirect (e. g., status code 307), redirecting the user to the tunnel. Periodic requests to check the state of the captive CP [4]. Thereby, the OS assumes a CN and displays the CP. network are exempted. When attempting to use a VPN in a CN, a Captive Deadlock can occur: in it, the leak prevention of a VPN client blocks V. VPN API STATUS QUO the communication with the CP that is necessary to gain an In this section, we describe the current state of system APIs Internet uplink, and thereby indirectly also blocks the route to available for VPNs on major platforms according to developer the VPN endpoint. documentation. a) Apple macOS and iOS: As part of their network III. RELATED WORK extension framework, Apple offers an API for creating VPN The security and privacy of public Wi-Fis and VPN client apps that build on Apple’s system VPN functionality (Per- software has been extensively studied in the literature. [1], [2], sonal VPN [11]) or provide custom protocol implementations [5] examine risks caused by public Wi-Fi and captive portals, (Packet Tunnel Provider [12]). This API offers always-on and the reason why people use them nonetheless. [6] and [7] functionality (R1) via so called on-demand rules, which can analyse the VPN clients on mobile platforms. [6], [8] and [9] be configured to trigger, e. g., when a Wi-Fi connection is verify the security and privacy claims of commercial VPN established [13]. According to the documentation, such on- clients. Among other things, they discover severe leakage of demand connection rules block outgoing traffic until the VPN IPv6 and DNS traffic: Up to 84% of VPN apps don’t tunnel tunnel is established (R3). IPv6 [6], and around 60% of VPN apps use Google’s DNS b) Android: Developers can build VPN apps using the servers, while only about 10% use own DNS resolvers [6]. system API and the BIND_VPN_SERVICE permission. VPN However, regarding traffic leakage during VPN connection apps can run in, among others, always-on (R1) and per-app establishment, there is very little prior work and—to the best mode. Always-on VPN connections are kept alive uncondi- of our knowledge—we are the first to analyse VPN clients tionally by the system as long as the device is running and and their behaviour in captive networks. Karlsson et al. [10] Internet connectivity is available. Developers of VPN apps present a prototypical device that connects to public Wi-Fis, can specify lists of allowed and disallowed apps whose traffic opens up a VPN tunnel and then creates an encrypted Wi-Fi is to be tunnelled through the VPN. It is also possible to for the user to connect to, such that all traffic is routed through block all connections outside the VPN tunnel, which results the VPN tunnel on the intermediate device. This mitigates the in disallowed apps losing all network connection [14]. startup leakage issue by moving it from the user device to the c) Windows 10: Always-on functionality (R1) is built in intermediate device which presumably exposes less sensitive as an auto-trigger for VPN profiles.1 In general, VPN profiles traffic of its own. However, we argue that the requirement to can be provided by a VPN app2 or via a mobile device maintain an additional device is impractical to most users. management mechanism to remote-join clients to a domain3. IV. REQUIREMENTS FOR SECURE VPN BOOTSTRAPPING d) Ubuntu GNU/Linux: Since the landscape of GNU/Linux distributions is very diverse, we focused To ensure a secure and privacy-preserving establishment of our analysis on the popular desktop distribution Ubuntu. VPN connections in public Wi-Fis, we propose the following Ubuntu uses NetworkManager (NM) as its high-level daemon requirements for secure VPN bootstrapping: for networking including VPN.