Headline
CVE-2022-45758: The XSS vulnerability exists in the latest version of SENS · Issue #19 · saysky/SENS
SENS v1.0 is vulnerable to Cross Site Scripting (XSS) via com.liuyanzhao.sens.web.controller.admin, getRegister.
This project allows for user registration. Audit the source code of registered users, the code location is com.liuyanzhao.sens.web.controller.admin#getRegister
The getRegister() method calls the userService.insert() method.
The insert() method calls the basicUserCheck(user) method.
The basicUserCheck() is used to check whether the form data is valid. In the basicUserCheck() method, parameters such as username length are restricted
But there is a problem here, which is that the code only limits the length, not the characters. So you can do XSS injection here.
Use the website provided by the project author to demonstrate the vulnerability.
The username is set to the payload of xss during user registration.
In this way, whether the malicious user comments on the article or publishes the article, the operation will be attacked by XSS.
The following is a malicious user comment, other users will access the XSS attack.
Solution: Add a filtering mechanism