Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
bug_report/bug_b
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
29 lines (23 sloc)
858 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| affected source code file: /admin/delete_image.php | |
| affected source code: | |
| <?php | |
| include ("includes/headerRefresh.php"); | |
| include ("includes/config.php"); | |
| include ("functions/functions.php"); | |
| require_once ("includes/session.php"); | |
| check_login(); | |
| $file = $_GET['file']; | |
| $folder = '../uploads/'; | |
| $file_path = $folder . $file; | |
| if (is_file($file_path)) { | |
| unlink($file_path); | |
| redirect_to("manage_uploads.php?deleted=1"); | |
| } | |
| ob_end_flush(); | |
| ?> | |
| affected function: unlink($file_path); | |
| affected executable: | |
| First, we can create a test file "test.txt" in root directory. | |
| Then, visit the Vulnerable URL: http://xx.xx.com/admin/delete_image.php?file=../test.txt | |
| and the "test.txt" file in the root directory will be deleted. | |
| That is, we can control the "delete_image.php?file=" parameter to delete any file through the relative path |