A QUIC(K) Way Through Your Firewall? Exploring Bypass Capabilities and Mitigation Strategies of Stateful Firewalls in the Presence of HTTP/3 / QUIC

A QUIC(K) Way Through Your Firewall? Exploring Bypass Capabilities and Mitigation Strategies of Stateful Firewalls in the Presence of HTTP/3 / QUIC

A QUIC(K) Way Through Your Firewall? Exploring Bypass Capabilities and Mitigation Strategies of Stateful Firewalls in the Presence of HTTP/3 / QUIC Konrad Yuri Gbur Florian Tschorsch Technische Universitat¨ Berlin Technische Universitat¨ Berlin [email protected][email protected] Abstract—The QUIC protocol is a new approach to combine HTTP/3 encryption and transport layer stream abstraction into one HTTP/2 protocol to lower latency and improve security. However, the Application QUIC decision to encrypt transport layer functionality may limit the Multistreaming Multistreaming capabilities of firewalls to protect networks. To identify these "Security" TLS TLS limitations we created a test environment and analyzed generated QUIC traffic from the viewpoint of a middlebox. This paper Stream Abstraction Stream Abstraction Transport shows that QUIC indeed exposes traditional stateful firewalls to TCP UDP UDP hole punching bypass attacks. On the contrary we show the robustness against censorship of QUIC through the encrypted Network IP transport layer design and analyze the capabilities to re-gain stateful tracking capabilities by deep packet inspection of the few exposed QUIC header fields. Fig. 1. Protocol stacks of HTTP/2 over TCP/TLS and HTTP/3 over QUIC based on [9] and [4]. The original ISO/OSI network stack did not include a I. INTRODUCTION specific security layer but TLS is usually regarded as a separate layer. Since the web was first proposed in 1989, the primary transport protocol used for all the Hypertext Transport Proto- Engineering Task Force (IETF) standardizes QUIC and HTTP/3 col (HTTP) traffic has been the Transmission Control Proto- which could lead to a change of the web’s core protocol from col (TCP). Providing a reliable data stream abstraction directly TCP to UDP in the near future [6]–[8]. in the transport layer of the ISO/OSI network protocol stack, However, besides the advantages through QUIC, the change TCP was more suitable than the connection-less User Datagram from TCP to UDP may inherit some security challenges for Protocol (UDP) for providing documents via HTTP [1], [2]. firewalls. Stateful firewalls rely on connection tracking to With the web transforming from hosting static documents distinguish which packets belong to a specific client-server only to hosting entire security-critical web applications such communication. For example, a web server firewall will only as online banking, encrypted communication became a core allow incoming traffic on the HTTP(S) ports 80 and 443 to requirement. As the original Internet protocol stack used establish a connection, as there is no need for a web server to for the web did not include any capabilities for encryption, initiate connections to hosts outside the intranet in most cases. the Secure Socket Layer (SSL), now called Transport Layer To distinguish connections, it is not sufficient to rely on IP Security (TLS), was introduced. Implementing the wanted addresses and ports only. The firewalls have to interpret more encryption capabilities, TLS requires additional handshakes, of the packets content to reconstruct the stream abstraction. resulting in two more round-trip times (RTT) to set up a secure In case of TCP, this can be implemented by analyzing the arXiv:2107.05939v1 [cs.CR] 13 Jul 2021 connection [3]. unencrypted SYN, ACK, FIN and RST flags in the TCP header The extra amount of RTTs became an issue for increasingly which indicate handshakes, flow directions and teardowns of popular real-time applications in high latency networks. The connections [10]. most prominent solution approach is the Quick UDP Internet Since QUIC merges the stream abstraction and the encryption Connection (QUIC), laying the foundation for the new HTTP/3 layer with the goal to provide as much privacy as possible and standard [4], [5]. The differences between the HTTP/2 and reduce latency, the relevant header fields for stateful connection HTTP/3 protocol are shown in Figure 1. It shows that QUIC tracking are encrypted as well. Only a minimum of header fields combines the transport layer stream abstraction, the encryption are exposed for analysis through middleboxes [4], [6]. Besides handling and parts of the application layer into one layer. By the limited insight a firewall could get from the few unencrypted combining these components, QUIC is able to eliminate the header fields, many stateful firewall implementations, may not two additional RTTs introduced by TLS [4]. QUIC can further even analyze protocol information above the transport layer be configured to utilize the new TLS 1.3 0-RTT handshake in the first place. QUIC is built on top of UDP to provide for known endpoints, completely eliminating the RTTs for compatibility with old network stacks and it is not regarded the connection setup. At the time of writing, the Internet as a transport layer protocol in a traditional view [4]. 1 Client Server TCP SYN # Generated by iptables-save v1.8.4 *filter TCP SYN,ACK :INPUT DROP [581:48486] TCP ACK :FORWARD DROP [0:0] :OUTPUT DROP [27:3466] -A INPUT -p tcp -m tcp --dport 443 -m conntrack TLS 1.3 CH: Supported Ciphers, Key Share --ctstate NEW,RELATED,ESTABLISHED -j ACCEPT TLS 1.3 SH: Chosen Ciphers, Key Share -A INPUT -p udp -m udp --dport 443 -m conntrack {Cert, Signature, FIN} --ctstate NEW,RELATED,ESTABLISHED -j ACCEPT TLS 1.3 {FIN} {HTTP GET...} -A OUTPUT -p tcp -m tcp --sport 443 -m conntrack TLS 1.3 {HTTP 200 OK...} --ctstate RELATED,ESTABLISHED -j ACCEPT -A OUTPUT -p udp -m udp --sport 443 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT Fig. 2. TCP/TLS 1.3 Handshakes for encrypted communication. COMMIT Fig. 3. The iptables rules deployed on the server. Firewalls built to perform a deep packet inspection above the transport layer have to parse the packets and decide heuristically which protocol is used in a general case because the transport II. BACKGROUND layer does not contain any information about the higher layer Since QUIC is directly built upon the encryption capabilities protocols. This could impact the performance of the firewall provided by TLS 1.3, this section introduces the basics of and might not be an option in many network scenarios [11]. how the TLS handshake, shown in Figure 2, works. The client Decker [12] has already shown that existing intrusion detection starts initiating the TCP 3-way handshake with a server that is systems (IDS) and intrusion prevention systems (IPS) are not listening on a specific port. After the stream is set up, the client able to detect malicious QUIC traffic and many providers sends a Client Hello (CH) message to the server along with of firewalls recommend not to use QUIC until sophisticated the supported cipher suites and the necessary key information methods for detection are developed. for one cipher suite (key share) that is most likely supported In this paper, we analyze how traditional transport layer by the server. The choice of algorithm could be preset or based stateful firewalls like the linux conntrack module cope based on a guess performed in the client implementation. On with QUIC. Our contributions are the following: receiving the CH, the server answers with a Server Hello (SH) containing the chosen cipher suite and the key share for the • We show that firewalls handling QUIC are prone to UDP server-side in plain text. Furthermore, the server certificate, the hole punching, a technique that is well known and has signature and a hashed transcript of the setup so far, called the been documented for years but so far has a limited effect Finished Message (FIN), are transmitted in the same message in the real world for web servers protected by firewalls. but already encrypted. If the data provided by the server is • We demonstrate the threats of UDP hole punching by trusted by the client and the validity of the FIN message is creating a reverse shell that would not be similarly possible confirmed, the client also sends an encrypted FIN message in a TCP/TLS scenario. finalizing the cryptographic handshake. Together with the FIN • Furthermore, we show that one of the reasons for this message from the client, the first application data can already attack being possible with QUIC is also the reason for its be transmitted [7], [13]. resistance to censorship. III. TESTING SETUP • We analyze which information are exposed by QUIC and can be used for stateful connection tracking without To test how QUIC traffic is working, a simple point-to-point reducing the censorship resistance. topology was chosen with a local firewall on the server. We have used the QUIC implementation quiche by Cloudflare [14] The paper is structured in the following way: Section II which provides a patch for Nginx to support HTTP/3 and can provides a short introduction into the concepts of stream be integrated into the curl [15] web client tool. The QUIC abstraction and encryption with TLS. Our testing setup is implementation by Cloudflare is based on the IETF QUIC and explained in Section III. In Section IV, we analyze how HTTP/3 drafts in revision 29 [6], [8]. Since curl also supports statefulness is implemented for UDP packets in iptables the current HTTP standard over TCP/TLS it can be used for utilizing conntrack and compare it to TCP in perspective of direct comparison of the TCP/TLS and QUIC protocol stacks. firewall bypass capabilities. First approaches to stateful tracking Both hosts are running as virtual machines (VM) in the same capabilities in QUIC in order to mitigate UDP hole punching local network. The client is an Ubuntu 20.04 64-bit with the are explored in Section V by dissecting the network traffic and local IP 192.168.79.132 and the server is an Ubuntu Server correlating it with the QUIC specification.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us