XSS vulnerability from Sourcecodester QR Code Attendance System 1.0 (delete-student.php)

CVE-2024-8172

A vulnerability, which was classified as problematic, has been found in SourceCodester QR Code Attendance System 1.0. This issue affects some unknown processing of the file /endpoint/delete-student.php. The manipulation of the argument student/attendance with an unknown input leads to a cross site scripting vulnerability. Using CWE to declare the problem leads to CWE-79. The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Impacted is integrity.

It is possible to read the advisory at github.com. The identification of this vulnerability is CVE-2024-8172. The exploitation is known to be easy. The attack may be initiated remotely. It demands that the victim is doing some kind of user interaction. Technical details as well as a public exploit are known. The attack technique deployed by this issue is T1059.007 according to MITRE ATT&CK.

Affected Project: QR Code Attendance System 1.0

Official Website: https://www.sourcecodester.com/php/17242/qr-code-attendance-system-using-php-and-mysql-source-code.html

Version: 1.0

Related Code file: delete-student.php

Injection parameter: student

Vulnerability Description

The student parameter is vulnerable to the tested XSS payload: %3cIMG%20%22%22%22%3e%3cSCRIPT%3ealert(%22XSS%22)%3c%2fSCRIPT%3e%22%3e. This string is encoded and when decoded, it attempts to inject a script into the webpage: <IMG """"><SCRIPT>alert("XSS")</SCRIPT>">

Application does not properly sanitize or validate the input, this script could be executed in the user’s browser, leading to an XSS attack.

Demonstration

Below is how QR Code Attendance System looks like:

Screenshot from 2024-08-25 23-41-57

We can delete student as such:

Screenshot from 2024-08-25 23-47-11

Intercept the delete(delete-student.php) traffic using Burp Suite and inject the following payload:

Screenshot from 2024-08-25 23-47-39

Payload used above is HTML encoded and decodes as <IMG """><SCRIPT>alert("XSS")</SCRIPT>">

Upon sending the modifying traffic containing XSS payload, we can verify the vulnerability:

Screenshot from 2024-08-25 23-47-45