When inspecting the charts generated by RIPS, a code execution vulnerability indicated as critical catches our eye. Investigating this issue closer quickly reveals that the vulnerability lies in the administrator panel, seemingly nulling the severity of the vulnerability. We will see later in this post that this is not the case. All issues were found in exactly 20 seconds inside of ~76,000 lines of code.
The truncated analysis results are available in our RIPS demo application. Please note that we limited the results to the issues described in this post since there are no fixes available.
We will now explain how a cross-site request forgery attack might lead to remote code execution. A second vulnerability-chain will be presented, a cross-site scripting vulnerability using SQL injection.
Remote Code Execution
The remote code execution vulnerability lies within an internal cronjob plugin. Since the cronjob plugin is deactivated by default, our vulnerability seems to be less severe. However, Redaxo does not make use of anti-CSRF protection mechanisms allowing an attacker to activate and install the plugin within a single sent HTTP request. The plugin enables administrators of Redaxo CMS to add cronjobs in form of PHP code to their site and execute them laterby.
This feature allows the following attack-scenario:
Whenever an authenticated administrator of Redaxo CMS 5.2.0 visits a malicious page like
- Activate and install the internal
cronjob-plugin by sending a GET request to the targeted server.
- Add a cronjob with malicious PHP-code which will be executed after a given period of time by sending a POST request.
These two HTTP-requests now yield in a remote code execution vulnerability. Note that the given PHP code will be stored in the SQL-database of Redaxo and not directly in an individual file.
In the given code snippet, the GET-parameter
opener_input_field is read from the request in line 5. Then, in line 10, the if-constraint ensures that the first thirteen characters of the
opener_input_field parameter have to be REX_LINK_LIST. Finally, in line 11, the first thirteen characters (REX_LINK_LIST) are removed from our input, and the result is stored in the
The payload can initiate the two previously introduced HTTP requests that lead to remote code execution. Contrarily to an CSRF attack, the attacker can prepare an URL that points to the domain of the targeted Redaxo installation instead of an attacker-controlled domain and, thus, gain more trust of the victim for visiting the URL.
Redaxo allows its users to make a backup of the SQL database. However, as can be seen in the following, it does not hinder the user to export any SQL tables not related to Redaxo, which is a great trampoline for us to further escalate our cross-site scripting vulnerability.
Shortly after retrieving the user input in line 20, the input parameter
EXPTABLES is passed unsanitized in the
exportDb() function which basically reads all fields and contents of the tables specified by the
EXPTABLES array. In the end, the query result is attached to the HTTP body.
|2016/09/15||First contact with vendor|
|2016/10/25||Vendor rates the issues as not critical|
|2016/11/29||Reminder sent to the vendor about the upcoming blog post|
One of the most important conclusions we take by this analysis should be the appeal to implement anti-CSRF measures for the web application, specifically for security-critical functionality. In addition to that, sufficient input sanitization has to be applied - in the frontend as well as in the administrators panel - to further secure the application against remote attacks.
The vendor does not consider the vulnerabilities severe because they are located in the administration area of the application and upcoming fixes are delayed indefinately.
Follow us on Twitter to be notified when the next gift of our advent calendar is opened!
APAV Time Table
Disclaimer: The information provided here is for educational purposes only. It is your responsibility to obey all applicable local, state and federal laws. RIPS Technologies GmbH assumes no liability and is not responsible for any misuse or damages caused by direct or indirect use of the information provided.