The vulnerability allows an authenticated user with file editor permissions to achieve Remote Code Execution (RCE). This is accomplished by first creating a file with a .php extension and then saving PHP code into it. The vulnerable functions are createFile and saveFile within the Fileeditor controller (modules/Fileeditor/Controllers/Fileeditor.php).
The createFile function was vulnerable because it allowed the creation of files with any extension, without restriction. An attacker could send a POST request to /backend/fileeditor/createFile with name=exploit.php to create a PHP file.
The saveFile function was vulnerable because it allowed writing arbitrary content to any file, without checking the file type. After creating the PHP file, an attacker could send a POST request to /backend/fileeditor/save with the path to the created file and a PHP webshell as the content.
The patch at commit 86be2930d1c54eb7575102563302b2f3bafcb653 introduces a whitelist of allowed file extensions (.css, .js, .html, .txt, .json, .sql, .md). Both createFile and saveFile functions were modified to validate the file extension against this whitelist before performing any file operations. This prevents the creation and editing of files with dangerous extensions like .php, thus mitigating the RCE vulnerability.