← Advisories

Tugux CMS 1.2 (pid) Remote Arbitrary File Deletion Vulnerability

Medium
Advisory ID
ZSL-2011-5024
Release Date
10 July 2011
Vendor
Tugux Studios - http://www.tugux.com
Affected Version
1.2
CVE
N/A
Tested On
Microsoft Windows XP Professional SP3 (EN), Apache 2.2.14 (Win32), PHP 5.3.1, MySQL 5.1.41
Summary

Tugux CMS is a free, open-source content Management system (CMS) and application that powers the entire web.

Description

Input passed to the 'pid' parameter in administrator/delete_page_parse.php is not properly sanitised before being used to delete files. This can be exploited to delete files with the permissions of the web server via directory traversal sequences passed within the 'pid' parameter.

/administrator/delete_page_parse.php ---------------- 1: <?php 2: ///post form data 3: $id=$_POST['pid']; 4: 5: $pic1 = ("slides/$id/image_01.jpg"); 6: if (file_exists($pic1)) { 7: unlink($pic1); 8: } 9: $dir = "slides/$id"; 10: rmdir($dir); 11: 12: include_once "../scripts/connect_to_mysql.php"; 13: $query = mysqli_query($myConnection, "DELETE FROM pages WHERE id='$id' ") or die (mysqli_error($myConnection)); 14: echo '<table align="center"><tr> <td><div style=" width:300px; margin:auto; border:1px solid #BBB; font-family:Arial, Helvetica, sans-serif; color:#666; text-align:center"> 15: <img src="images/check.png" width="90" height="87"><br /> 16: Operation completed.Your page has been DELETED.<br /> 17: <a href="index.php">Click Here to go back</a></div></td></tr></table>'; 18: exit(); 19: ?>
Proof of Concept
Disclosure Timeline
N/A
Credits
Vulnerability discovered by Gjoko Krstic
References
Changelog
10.07.2011Initial release
11.07.2011Added reference [2], [3] and [4]
12.07.2011Added reference [5]
20.07.2011Added reference [6]