Chaining Multiple Vulnerabilities to Achieve RCE in Kerio Control
Kerio Control contained an HTTP response splitting flaw in several non-authenticated endpoints that could be turned into reflected XSS, which was then used to steal CSRF tokens and upload a malicious file, ultimately leading to remote code execution. An attacker could chain these issues to execute arbitrary commands with root privileges.
Published on medium.com
A critical vulnerability chain was discovered in Kerio Control that allows an attacker to achieve Remote Code Execution (RCE) through a series of chained vulnerabilities. The attack combines HTTP Response Splitting, Cross-Site Scripting (XSS), CSRF token theft, and insecure file upload to gain unauthorized system…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the 'dest' parameter was not properly sanitised for newline characters, allowing HTTP response splitting, and missing X-Frame-Options enabled CSRF token theft, while file upload validation was insufficient.
Impact
An attacker could achieve remote code execution with root privileges, leading to full system compromise.
What the attacker needed
Victim clicks a crafted link; attacker can host a malicious page; target runs vulnerable Kerio Control
How it was found
- Inject newline characters into the 'dest' parameter of a non-authenticated endpoint to split HTTP response headers.
- Use the response splitting to inject malicious JavaScript, encoding it with zlib and setting a custom Content-Length header.
- Create an iframe to access the admin directory and steal CSRF tokens from cookies.
- Upload a malicious shell script packaged as a .tar file renamed to .img and base64 encoded, using the stolen tokens.
- Leverage an existing Kerio vulnerability to execute the uploaded .img file with root privileges, establishing a reverse shell.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
This report describes a chain of bugs in a firewall product. First, the server could be tricked into adding extra lines to its response headers, which let the attacker inject JavaScript into the page. That script then stole security tokens from the admin interface, which were used to upload a harmful file that the system later ran with high privileges, giving the attacker control of the device.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.