{"id":58595,"date":"2024-08-02T19:40:35","date_gmt":"2024-08-02T16:40:35","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/179890\/clms10-escalate.txt"},"modified":"2024-08-02T19:40:35","modified_gmt":"2024-08-02T16:40:35","slug":"computer-laboratory-management-system-1-0-privilege-escalation","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/computer-laboratory-management-system-1-0-privilege-escalation\/","title":{"rendered":"Computer Laboratory Management System 1.0 Privilege Escalation"},"content":{"rendered":"<p># Exploit Title: Computer Laboratory Management System v1.0 &#8211; Incorrect access control<br \/># Date: 08 July 2024<br \/># Exploit Author: Sampath kumar kadajari<br \/># Vendor Homepage: https:\/\/www.sourcecodester.com\/php\/17268\/computer-laboratory-management-system-using-php-and-mysql.html<br \/># Software Link: https:\/\/www.sourcecodester.com\/download-code?nid=17268&amp;title=Computer+Laboratory+Management+System+using+PHP+and+MySQL<br \/># Version: v1.0<br \/># CVE: CVE-2024-41332<br \/># Tested on: Windows, XAMPP, Apache, MySQL<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Incorrect access control in the delete_category function of Sourcecodester Computer Laboratory Management System v1.0 allows authenticated attackers with low-level privileges to perform arbitrarily delete actions. <\/p>\n<p>&#8220;Vulnerable Code&#8221; \u2013 ( classes\/master.php)<\/p>\n<p>function delete_category(){<br \/>extract($_POST);<br \/>$del = $this-&gt;conn-&gt;query(&#8220;UPDATE `category_list` set `delete_flag` = 1 where id = &#8216;{$id}'&#8221;);<br \/>if($del){<br \/>$resp[&#8216;status&#8217;] = &#8216;success&#8217;;<br \/>$this-&gt;settings-&gt;set_flashdata(&#8216;success&#8217;,&#8221; Category successfully deleted.&#8221;);<br \/>}else{<br \/>$resp[&#8216;status&#8217;] = &#8216;failed&#8217;;<br \/>$resp[&#8216;error&#8217;] = $this-&gt;conn-&gt;error;<br \/>}<br \/>return json_encode($resp);<br \/>}<\/p>\n<p>&#8212;&gt; Affected Component: http:\/\/localhost\/php-lms\/classes\/Master.php?f=delete_category<\/p>\n<p>&#8220;Fix for Vulnerable Code&#8221;:<\/p>\n<p>function delete_category(){<br \/>\/\/ Check if the user is logged in and has an admin role<br \/>if (!isset($_SESSION[&#8216;userdata&#8217;][&#8216;role&#8217;]) || $_SESSION[&#8216;userdata&#8217;][&#8216;role&#8217;] != &#8216;admin&#8217;) {<br \/>$resp[&#8216;status&#8217;] = &#8216;failed&#8217;;<br \/>$resp[&#8216;error&#8217;] = &#8216;Unauthorized access.&#8217;;<br \/>return json_encode($resp);<br \/>}<\/p>\n<p>\/\/ Proceed with the delete action if authorized<br \/>extract($_POST);<br \/>$del = $this-&gt;conn-&gt;query(&#8220;UPDATE `category_list` set `delete_flag` = 1 where id = &#8216;{$id}'&#8221;);<br \/>if($del){<br \/>$resp[&#8216;status&#8217;] = &#8216;success&#8217;;<br \/>$this-&gt;settings-&gt;set_flashdata(&#8216;success&#8217;,&#8221;Category successfully deleted.&#8221;);<br \/>}else{<br \/>$resp[&#8216;status&#8217;] = &#8216;failed&#8217;;<br \/>$resp[&#8216;error&#8217;] = $this-&gt;conn-&gt;error;<br \/>}<br \/>return json_encode($resp);<br \/>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: Computer Laboratory Management System v1.0 &#8211; Incorrect access control# Date: 08 July 2024# Exploit Author: Sampath kumar kadajari# Vendor Homepage: https:\/\/www.sourcecodester.com\/php\/17268\/computer-laboratory-management-system-using-php-and-mysql.html# Software Link: https:\/\/www.sourcecodester.com\/download-code?nid=17268&amp;title=Computer+Laboratory+Management+System+using+PHP+and+MySQL# Version: v1.0# CVE: CVE-2024-41332# Tested on: Windows, XAMPP, Apache, MySQL &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- Incorrect access control in the delete_category function of Sourcecodester Computer Laboratory Management System v1.0 allows authenticated attackers &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-58595","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/58595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=58595"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/58595\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=58595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=58595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=58595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}