Recent cybersecurity research revealed a set of critical HTTP Response Splitting vulnerabilities in Kerio Control, a widely used Unified Threat Management (UTM) solution developed by GFI Software. The impact of these vulnerabilities is severe, potentially allowing attackers to escalate low-severity issues into one-click remote command execution (RCE) attacks that provide root access to the firewall system. These vulnerabilities, collectively tracked as CVE-2024-52875 (or KIS-2024-07), have existed in the software for nearly seven years. They affect Kerio Control versions ranging from 9.2.5, released in March 2018, to version 9.4.5. Understanding how these vulnerabilities function and the mechanisms behind such exploits can shed light on the importance of maintaining rigorous security protocols and regular software updates.
HTTP Response Splitting Vulnerabilities
The vulnerabilities in Kerio Control’s UTM system stem from a CRLF Injection bug in several web interface pages. This includes pages such as /nonauth/addCertException.cs, /nonauth/guestConfirm.cs, and /nonauth/expiration.cs. The issue revolves around improper sanitization of user input passed via the dest GET parameter, which generates a “Location” HTTP header in a 302 Found response. Specifically, the application fails to strip Line Feed (LF) characters (n), allowing attackers to exploit the software for various malicious activities, such as HTTP Response Splitting, Open Redirects, and Reflected Cross-Site Scripting (XSS).
By manipulating the HTTP response, attackers can inject payloads encoded in Base64 into the dest parameter. This manipulation allows them to add arbitrary HTTP headers and custom HTML content, leading to several attacks. For instance, open redirect attacks can occur when attackers inject a malicious URL as the dest parameter, redirecting users to external websites they control. Additionally, HTTP Response Splitting enables attackers to exploit poorly handled LF sequences, splitting HTTP responses and injecting arbitrary data into the response body. This mechanism can facilitate reflected XSS attacks, where custom scripts execute in the victim’s browser.
How the Exploit Works
Initially classified as a “Low” severity issue because it required user interaction, further analysis revealed that these vulnerabilities could be escalated to High (8.8) severity. By leveraging a nine-year-old exploit in Kerio Control’s upgrade functionality, attackers could deliver an RCE payload with just one click. For example, by using an iframe to load resources under the /admin/ path, attackers could bypass cookie restrictions and access the CSRF token necessary for administrative actions.
Moreover, attackers can abuse Kerio Control’s firmware upgrade feature to execute remote commands. The exploit takes advantage of improperly handled .img files in the upgrade functionality. Attackers can package a malicious script in a .tar.gz file, rename it to .img, and upload it as a firmware upgrade. If the script contains shell commands, they execute with root privileges, granting attackers control over the system. A Proof of Concept (PoC) script demonstrated how a victim Kerio Control admin could be tricked into visiting a malicious link, resulting in the execution of the attacker’s script and giving the attacker a root shell on the Kerio Control instance.
Real-World Implications
Kerio Control is trusted to safeguard networks worldwide, with approximately 20,000 instances actively deployed on the internet, according to Censys data. These vulnerabilities pose a significant threat to organizations relying on the software to secure their infrastructure. The discovery of CVE-2024-52875 highlights critical cybersecurity lessons: even security products need rigorous maintenance to avoid becoming vectors for exploitation.
The exploit used in Kerio Control stems from a vulnerability disclosed nearly a decade ago, pointing to a worrying gap in code audits and updates. Attackers’ creative use of techniques like XSS, cookie theft, and firmware abuse demonstrates the potential escalation of seemingly minor issues into devastating breaches. The vulnerabilities discovered were responsibly disclosed to GFI Software, which was urged to release a patch for protection.
Moving Forward
Initially labeled a “Low” severity issue due to the need for user interaction, further analysis showed these vulnerabilities could be classified as High (8.8) severity. By exploiting a nine-year-old flaw in Kerio Control’s upgrade functionality, attackers could deliver an RCE payload with a single click. For instance, attackers can use an iframe to load resources under the /admin/ path, bypassing cookie restrictions and accessing the CSRF token needed for administrative actions.
Additionally, attackers can exploit Kerio Control’s firmware upgrade feature to run remote commands. The vulnerability arises from improperly handled .img files in the upgrade process. Attackers can package a malicious script in a .tar.gz file, rename it to .img, and upload it as a firmware upgrade. If the script includes shell commands, they execute with root privileges, giving attackers control over the system. A Proof of Concept (PoC) script demonstrated that a Kerio Control admin could be tricked into visiting a malicious link, resulting in the execution of the attacker’s script and granting the attacker root shell access to the Kerio Control instance.