F5 BIG-IP critical vulnerability exploited by attackers to gain unauthenticated RCE
Written by Aarush Ahuja
Co-founder @ FourCore
If you are a user of F5 BIG-IP application services, you might be vulnerable to an unauthenticated RCE being actively exploited by attackers. It is recorded as CVE-2022-1388 and has a CVSS score of 9.8 out of 10! It is a vulnerability in the iControl REST interfaced of F5's BIG-IP solution. It can be exploited by threat actors on F5 BIG-IP admin dashboard exposed to the internet. Attackers are already seen to be exploiting the vulnerability in the wild!
Are you vulnerable to CVE-2022-1388?
F5 BIG-IP application services product with the following versions are vulnerable:
16.1.0 - 16.1.2
15.1.0 - 15.1.5
14.1.0 - 14.1.4
13.1.0 - 13.1.4
12.1.0 - 12.1.6
11.6.1 - 11.6.5
The iControl REST service is a Java application with exposed by Apache webserver as the reverse proxy. The vulnerability exists in the flow of the authentication mechanism between Apache and the iControl application. F5 uses a custom Apache authentication module which performs authentication on requests flowing into Apache, it verifies the presence of the X-F5-Auth-Token and sends the request to the iControl application if it is present otherwise it is rejected.
If a request without the X-F5-Auth-Token header is passed into the iControl REST application, the application takes an alternate route and fulfils the request without the need of a token. The custom authentication module prevents an attacker from sending a request without a X-F5-Auth-Token header being passed to the iControl application.
However, in the authentication module, the check for the X-F5-Auth-Token is done before the Connection header is processed. Apart from the usual functionality of the Connection header, it can also be used to indicate that certain headers must be removed by the proxy. We can use this to indicate the authentication module to remove the X-F5-Auth-Token header and send it to the iControl application. As the basic token presence check is performed before processing the Connection header, it can be used to bypass the authentication module.
CVE-2022-1388 is trivial to exploit!
One can trivially craft a payload to execute arbritrary commands on a vulnerable system. The management API consists of a convenient command execution endpoint which can now be accessed because of the vulnerability.