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
{{ message }}
This repository has been archived by the owner on May 19, 2020. It is now read-only.
An authenticated user can use a path traversal attack (../) in the site settings page to include and run PHP files that exist outside of the webroot.
Expected Behaviour
The application should sanitize and remove all ../ in the path of the new theme to be used.
Actual Behaviour
The application takes the full name of the theme, and appends it to the path of the webroot, meaning, a malicious user can simply back out of the web root and include other php files.
This can then be used to trigger the PHP files and achieve RCE.
Context details (if applicable)
Anchor version: 0.12.7
Server setup:
Reproduce:
Go to site settings in the "extend" tab, click save and capture the request in burp, this request should look something like:
After sending said request, we can trigger the PHP file to be run by accessing either the main page (this will run the PHP file /var/www/html/../../../../../../../../../../../../home/user/posts.php) or going to a file that doesn't exists (this will run the PHP file /var/www/html/../../../../../../../../../../../../home/user/404.php). The file names to be run are not optional as far as I can tell, but there could be a way with further investigation.
This attack can be combined with some sort of third file upload, such as an ftp, smb or attachment upload to achieve RCE on the remote server.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Summary
An authenticated user can use a path traversal attack (
../
) in the site settings page to include and run PHP files that exist outside of the webroot.Expected Behaviour
The application should sanitize and remove all
../
in the path of the new theme to be used.Actual Behaviour
The application takes the full name of the theme, and appends it to the path of the webroot, meaning, a malicious user can simply back out of the web root and include other php files.
This can then be used to trigger the PHP files and achieve RCE.
Context details (if applicable)
Go to site settings in the "extend" tab, click save and capture the request in burp, this request should look something like:
We can then modify the "theme" value to be whatever file we want to include, for example:
After sending said request, we can trigger the PHP file to be run by accessing either the main page (this will run the PHP file
/var/www/html/../../../../../../../../../../../../home/user/posts.php
) or going to a file that doesn't exists (this will run the PHP file/var/www/html/../../../../../../../../../../../../home/user/404.php
). The file names to be run are not optional as far as I can tell, but there could be a way with further investigation.This attack can be combined with some sort of third file upload, such as an ftp, smb or attachment upload to achieve RCE on the remote server.
The text was updated successfully, but these errors were encountered: