Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The XSS vulnerability exists in the latest version of SENS #19

Open
altEr1125 opened this issue Nov 19, 2022 · 0 comments
Open

The XSS vulnerability exists in the latest version of SENS #19

altEr1125 opened this issue Nov 19, 2022 · 0 comments

Comments

@altEr1125
Copy link

This project allows for user registration. Audit the source code of registered users, the code location is com.liuyanzhao.sens.web.controller.admin#getRegister

image

The getRegister() method calls the userService.insert() method.

image

The insert() method calls the basicUserCheck(user) method.

image

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.

image

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.

image

Solution: Add a filtering mechanism

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant