HAProxy is one of the most widely used open-source software load balancer proxy servers for Hypertext Transfer Protocol (HTTP) and Transmission Control Protocol (TCP) applications. The software gained high popularity due to it being free as well as the promise of being the “world’s fastest” [4] load balancer. Currently, it is now integrated on most Linux distributions (Ubuntu, Debian 8, and CentOS) and is the default deployment for cloud platforms (Amazon AWS, Azure, and Google Cloud). Designed for websites with a large amount of inbound and outbound traffic, many well know high-traffic sites like Virgin America, Booking.com, Airbnb, and Instagram utilize the software. [5]
On September 7, 2021, the JFrog Security research team discovered that HAProxy versions 2.0 or later were subject to integer overflow vulnerability which allows the attacker to conduct an HTTP request smuggling attack. [5] To conduct this attack, the malicious actor manipulates the HTTP request header by adding a character to the “content-length” header. [3] Unable to process the contradicting lengths between the “content-length” and “transfer-encoding” headers [1], the request is given access to the backend server, bypassing the access control lists.
Vulnerability
CVE-2021-40346 – Ubuntu 20.04 LTS / 21.04: HAProxy vulnerabilities (USN-5063-1). [2][6] The vulnerability is an integer overflow vulnerability that allows an attacker to conduct an HTTP request smuggling attack to the backend server, without being detected by the proxy server. [5]
Impact
With over 500 million downloads [3] and standard applications on Linux distributions and cloud platforms, the impact of this vulnerability could potentially lead to sensitive data loss, escalation of privileges, hijacking user sessions, and exploiting cross-site scripting without user interaction. [5] This means that the attacker has full access to affected servers and plenty of targets to exploit. The attacker could also conduct further vulnerability scans to detect other exploitable vulnerabilities within the server, further enabling the attackers to prolong their attack.
Mitigation
The mitigation for this vulnerability is to update to versions 2.0.25, 2.2.17, 2.3.14, and 2.4.4 by adding size checks for the name and value lengths. [1]