
CVE-2018-11686 - FlexPaper PHP Publish Service RCE <= 2.3.6
CVE-2018-11686 - FlexPaper PHP Publish Service RCE <= 2.3.6

found by Red Timmy Security
Technical Analysis:
Security advisory:
The file change_config.php of FlexPaper (PHP) doesn't check if the adminsitrator is authentication properly, allowing an attacker to delete arbitrary files on the server:

unlink PHP functionAn attacker can craft a request like this and delete files on the folder of his choice:
POST /flexpaper/php/change_config.php HTTP/1.1
Host: 127.0.0.1:8888
[...]
SAVE_CONFIG=1&SWF_Directory=config/
With this request, an attacker deletes all files on the config directory.
Since all files on the config/ folder are deleted, FlexPaper will think that the application has never been initialized:

Therefore an attacker is able to setup again the FlexPaper. But why ?
Inside the setup.php there is a function called pdf2swfEnabled that uses the command exec in PHP with a parameter passed in POST by the user. Since this is the initialisation (check 2.) of FlexPaper there is no authentication.

An attacker can craft a payload like this: ?step=4&PDF2SWF_PATH=id; resulting exec(id; --version 2>&1).
The attacker can redirect the output of the command inside the a file inside the config folder and make a GET request to read the output:

The check of the authentication has been added at the beginning of the change_config.php
